Hi Josh, On Sun, 06 Sep 2009 17:14:34 -0700, Josh Triplett wrote:
> "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". I've talked with the man-db maintainer, and he explained me how this "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 -- . ''`. Debian maintainer | http://wiki.debian.org/DavidPaleino : :' : Linuxer #334216 --|-- http://www.hanskalabs.net/ `. `'` GPG: 1392B174 ----|---- http://snipr.com/qa_page `- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
signature.asc
Description: PGP signature