Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

man(1) clarify searching + minor nits #1438

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

concussious
Copy link
Contributor

@concussious concussious commented Sep 28, 2024

Attempt to clarify search while maintaining terseness. Inspired by conversations on community discord!

Unresolved:

  1. I'm having trouble understanding example 3, it doesn't find anything on my sparse but inhabited boxen.
  2. logic preventing incompatible flags from being used together (e.g. man -Kk, seems to start around line 600) is not working on CURRENT. I tried playing with it but I don't understand it enough yet.

Cc @tetlowgm

@concussious
Copy link
Contributor Author

concussious commented Sep 28, 2024

I think these changes should be sensible and non-controversial, but perhaps controversially I'd love to:

  1. Use A a B b sorting like other manuals
  2. s/online/local/. Online is traditional language since ancient times, and I feel tenderly about that, but I'm concerned that nobody who didn't already know knows what that means.

@concussious concussious changed the title man.1: clarify searching + minor nits man(1) clarify searching + minor nits Sep 29, 2024
Copy link

@elliejs elliejs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I love these incremental improvements. I wrote a few tiny nitpicks but for the most part I think this looks splendid.

This PR works on my machine and the build failures appear to be due to the build system being throttled, not a syntax error.

usr.bin/man/man.1 Show resolved Hide resolved
usr.bin/man/man.1 Outdated Show resolved Hide resolved
usr.bin/man/man.sh Outdated Show resolved Hide resolved
echo ' [-m arch[:machine]] [-p [eprtv]] [mansect] page [...]'
echo ' man -f page [...] -- Emulates whatis(1)'
echo ' man -k page [...] -- Emulates apropos(1)'
echo ' man -K | -f | -k expression [...] -- Search manual pages'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance 'expression' is confusing and should be 'regexp' ? either are better than 'page', that's for sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that regexp is less ambiguous for people new to unix, but the term expression is elegant and used in all the rest of the manual manuals like apropos. Also, man -k expression does show re_format(7) - POSIX 1003.2 regular expressions.

@concussious
Copy link
Contributor Author

Thanks for the review! I worked egrep back into -K description.

People are often stunned by robust manual search functionality on
the community discord, so attempt to tidy doc regarding search by:
+ consolidate and standardize search options in synopsis and usage
+ call regular expressions `expression` like other manual pages
+ explain what search related flags do instead of using similies
+ crossreference the regular expression manual instead of egrep(1)

While here, polish and wax:
+ use consistent spacing and form (Ql) for quoted literals
+ clean a few linter errors regarding self xref and nospace
+ tidy examples + align files + tag spdx

Notes on currently outstanding issues:
- man.1 example 3 is confusing, and shows no results on my boxen
- logic preventing -Kk from being used together isn't working

MFC after:	3 days
usr.bin/man/man.1 Outdated Show resolved Hide resolved
@bsdimp
Copy link
Member

bsdimp commented Oct 4, 2024

this may need other changes, but can we not change whitespace on the man pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants