#545411 "man cmd subcmd" now works; please update bash-completion accordingly

#545411#3
Date:
2009-09-07 00:14:34 UTC
From:
To:
"man cmd subcmd" (for instance, "man git clone") now works with current
man-db.  Please consider updating bash-completion accordingly, so that
"man git cl[TAB]" suggests "git clone" and "git clean" rather than
manpages starting with "cl".

- Josh Triplett

#545411#10
Date:
2009-09-17 14:52:58 UTC
From:
To:
Hi Josh,
"subcommand" feature works.

In pratice, if you pass "foo bar" to man(1), it will
try /usr/share/man/man*/foo-bar.* first, then "foo" and "bar" separately.

Obviously, this is not very foolproof: in case of "man hg ssh", one wants to
read manuals for mercurial (hg) and ssh. *But* there's also "hg-ssh" available
(at least on my system), and that's not a hg subcommand.

$ man -w hg ssh
/usr/share/man/man8/hg-ssh.8.gz
$ LANG=C hg ssh 1>/dev/null
hg: unknown command 'ssh'
$

So, we could (*could*, haven't written a single line of code yet) provide some
completions, but not very foolproof:

$ whatis -w 'git-*' | awk '{print $1}' | sed -e "s/git-//g" | head -n3
add
am
annotate
$ whatis -w 'hg-*' | awk '{print $1}' | sed -e "s/hg-//g" | head -n3
ssh
$


I'll give it a try :)
David