diff options
Diffstat (limited to 'completions/info')
-rw-r--r-- | completions/info | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/completions/info b/completions/info index 87179ac8..f50f8424 100644 --- a/completions/info +++ b/completions/info @@ -6,13 +6,13 @@ _info() _init_completion -s || return # default completion if parameter looks like a path - if [[ "$cur" == @(*/|[.~])* ]]; then + if [[ $cur == @(*/|[.~])* ]]; then _filedir return fi case $prev in - --apropos|--index-search|--node|--help|--version|-!(-*)[knhv]) + --apropos | --index-search | --node | --help | --version | -!(-*)[knhv]) return ;; -!(-*)d) @@ -25,7 +25,7 @@ _info() _filedir -d return ;; - --dribble|--file|--output|--restore|--raw-filename|--rcfile|-!(-*)[for]) + --dribble | --file | --output | --restore | --raw-filename | --rcfile | -!(-*)[for]) _filedir return ;; @@ -34,14 +34,14 @@ _info() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local i infopath=/usr/share/info - if [[ $INFOPATH == *: ]]; then + if [[ ${INFOPATH-} == *: ]]; then infopath=${INFOPATH}${infopath} elif [[ ${INFOPATH:+set} ]]; then infopath=$INFOPATH @@ -57,18 +57,18 @@ _info() fi # redirect stderr for when path doesn't exist - COMPREPLY=( $(eval command ls "$infopath" 2>/dev/null) ) + COMPREPLY=($(eval command ls "$infopath" 2>/dev/null)) # weed out directory path names and paths to info pages - COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) + COMPREPLY=(${COMPREPLY[@]##*/?(:)}) # weed out info dir file - for (( i=0 ; i < ${#COMPREPLY[@]} ; ++i )); do - [[ ${COMPREPLY[$i]} == dir ]] && unset "COMPREPLY[$i]" + for i in ${!COMPREPLY[*]}; do + [[ ${COMPREPLY[i]} == dir ]] && unset "COMPREPLY[i]" done # strip suffix from info pages - COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|xz|lzma)} ) - COMPREPLY=( $(compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}") ) + COMPREPLY=(${COMPREPLY[@]%.@(gz|bz2|xz|lzma)}) + COMPREPLY=($(compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}")) } && -complete -F _info info pinfo + complete -F _info info pinfo # ex: filetype=sh |