CFR: Replace man/manpath/whatis/apropos with a shell script
swell.k at gmail.com
Thu Sep 9 19:55:44 UTC 2010
Gordon Tetlow <gordon at freebsd.org> writes:
> Gordon Tetlow <gordon at freebsd.org> writes:
>> Anonymous <swell.k at gmail.com> writes:
>>> It doesn't search in bin/../man nor in bin/.man. For example,
>>> my PATH contains $LOCALBASE/bin:$HOME/.bin, while /etc/
>>> is default one and contains /usr/local/man which does not
>>> exist here.
>> Guess I missed that pretty badly in my port. I'll go back and
>> retool the logic for this but that'll take a bit of time.
> Added. Latest version at http://people.freebsd.org/~gordon/man.sh
The order is still bogus compared to gnu man. If I don't like our
ancient GNU tools and altered PATH in order to prefer ones from ports
then I certainly don't want to view old manpages, too. The base manpath
should be appended *after* any PATH substitutions.
$ man -aw gperf # man.sh
$ man -aw gperf # gnu man
> $ echo $PATH
And it doesn't show anything when there are no arguments, not even
returning with exit code > 0.
$ man # man.sh
$ man # gnu man
What manual page do you want?
zsh: exit 1 man
> It's a slightly different heuristic than the existing man
> implementation since I don't support the notion of MANPATH_MAP.
> Here's the order:
> Default manpaths (/usr/share/man:/usr/share/openssl/man:/usr/local/
> Parse $PATH (path/man:path/MAN:(if ending in /bin)path/../man)
> Parse config files
More information about the freebsd-current