[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-151-g1709686
Ville Skyttä
ville.skytta at iki.fi
Thu Apr 28 18:46:01 UTC 2011
The following commit has been merged in the master branch:
commit f8de014a3e712e1bf6589895657d4f263afa6707
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Thu Apr 28 20:56:59 2011 +0300
info: Add option completion support.
diff --git a/completions/info b/completions/info
index e73b895..0045ddc 100644
--- a/completions/info
+++ b/completions/info
@@ -5,16 +5,40 @@ have info || return
_info()
{
local cur prev words cword
- _init_completion || return
+ _init_completion -n = || return
_expand || return 0
+ local split=false
+ _split_longopt && split=true
+
# default completion if parameter looks like a path
if [[ "$cur" == @(*/|[.~])* ]]; then
_filedir
return 0
fi
+ case $prev in
+ -k|--apropos|--index-search|-n|--node)
+ return
+ ;;
+ -d|--directory)
+ _filedir -d
+ return
+ ;;
+ --dribble|-f|--file|-o|--output|--restore)
+ _filedir
+ return
+ ;;
+ esac
+
+ $split && return
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return
+ fi
+
local i infopath=/usr/share/info
if [ "${INFOPATH: -1:1}" == ':' ]; then
--
bash-completion
More information about the Bash-completion-commits
mailing list