[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 7bc1813148b74557f1d3314947723f7d41e2b6b5
David Paleino
d.paleino at gmail.com
Thu Sep 17 16:27:07 UTC 2009
The following commit has been merged in the master branch:
commit 7bc1813148b74557f1d3314947723f7d41e2b6b5
Author: David Paleino <d.paleino at gmail.com>
Date: Thu Sep 17 18:25:25 2009 +0200
Revert "Support "man cmd subcmd" completion in contrib/man (Debian: #545411)"
This reverts commit 584bc520dfbc0e6a7e949b885bb9b949f99a1ff9.
This commit broke "general" man completion, trying to give "pages"
(from man-pages(7)) after $ man |. This would've been ok only if
$ man man | (man man pages indeed works). Trying to look for a fix :)
diff --git a/CHANGES b/CHANGES
index 53a369f..3b08b10 100644
--- a/CHANGES
+++ b/CHANGES
@@ -36,7 +36,6 @@ bash-completion (1.x)
* Improve qemu completion (Debian: #534901)
* Added sshfs completion (shares the same as scp) (Debian: #545978)
* Fixed obvious brokenness (typos) in contrib/mdadm
- * Support "man cmd subcmd" completion in contrib/man (Debian: #545411)
[ Ville Skyttä ]
* Split yum completion to contrib/_yum (no longer installed by default, the
diff --git a/contrib/man b/contrib/man
index 883214f..89bf877 100644
--- a/contrib/man
+++ b/contrib/man
@@ -8,7 +8,7 @@
-o $UNAME = OpenBSD ] &&
_man()
{
- local cur i prev sect manpath manext mansect uname version subcommands
+ local cur i prev sect manpath manext mansect uname
manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@(gz|bz2|lzma))"
mansect="@([0-9lnp]|[0-9][px]|3pm)"
@@ -16,7 +16,6 @@ _man()
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
- version=$(man --version | cut -d\ -f2)
if [[ "$prev" == -l ]]; then
_filedir $manext
@@ -53,19 +52,6 @@ _man()
manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }"
fi
- # Check whether $prev has "subcommand" manpages -- not always right! (try man hg ssh, then $ hg ssh)
- # Unfortunately, there's no way to check whether a completion is a valid subcommand or not.
- # man cmd subcmd is only supported from man-db 2.5.6
- if ([ ${version:0:1} -eq 2 ] && [ ${version:2:1} -eq 5 ] && [ ${version:4:1} -gt 5 ]) ||
- ([ ${version:0:1} -eq 2 ] && [ ${version:2:1} -gt 5 ]) ||
- [ ${version:0:1} -gt 2 ]; then
- subcommands=$(whatis -w "$prev-*" | awk '{print $1}' | sed -e "s/$prev-//g" | tr "\n" " ")
- if [ -n "$subcommands" ]; then
- COMPREPLY=( $( compgen -W "$subcommands" -- $cur ) )
- return 0
- fi
- fi
-
# redirect stderr for when path doesn't exist
COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) )
# weed out directory path names and paths to man pages
--
bash-completion
More information about the Bash-completion-commits
mailing list