info: Add option completion support.
This commit is contained in:
parent
0c810d1471
commit
f8de014a3e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user