whichMan.sh "some string that may appear in some package's manpage"
Because sometimes I don't know which manpage to consult to get info about something.
This tools greps all the manpages for that something, then shows you excerpts of what it found and that helps you find or decide which manpage to consult to get in depth info about the subject you're researching.
Here's a good example:
man -aK
does this too, more or less,
but it makes you cycle manually through each
manpage it finds and doesn't provide you
with a good overview of the matches.
It is barely usable.
In the above case man -aK localoptions
would have sufficed
since only one manpage matches.
But in the case below, man -aK 'brace expansion'
shows
its limits. You have to cycle through all the packages.
Whereas my script returns:
So with whichMan 'brace expansion'
, in a single glance,
you understand that to go more in-depth you need to run:
man zshexpn
It doesn't seem to work with bash, for some reason I haven't yet investigated, so currently the script is zsh-only.
zsh
is the best shell anyway, so give it a go, but always customize
it with ohmyzsh, because the defaults suck
and zsh
will actually seem worse than bash until you've configured it properly.
For the fun of it, and to level-up in shell scripting.
I know this tool could have been written in a way more readable way, and I will do it too, eventually.