diff options
Diffstat (limited to 'completions/sh')
-rw-r--r-- | completions/sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/completions/sh b/completions/sh index 93f00952..5624ffa3 100644 --- a/completions/sh +++ b/completions/sh @@ -9,28 +9,28 @@ _sh() -c) return ;; - -o|+o) - COMPREPLY=( $(compgen -W 'allexport errexit ignoreeof monitor + -o | +o) + COMPREPLY=($(compgen -W 'allexport errexit ignoreeof monitor noclobber noglob noexec nolog notify nounset verbose vi - xtrace' -- "$cur") ) + xtrace' -- "$cur")) return ;; esac local opts="-a -b -C -e -f -h -i -m -n -o -u -v -x" - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W "$opts -c -s" -- "$cur") ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W "$opts -c -s" -- "$cur")) return - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $(compgen -W "${opts//-/+}" -- "$cur") ) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W "${opts//-/+}" -- "$cur")) return fi local args ext= _count_args "" "@(-c|[-+]o)" - [[ $args -eq 1 ]] && ext=sh + ((args == 1)) && ext="sh" _filedir $ext } && -complete -F _sh sh + complete -F _sh sh # ex: filetype=sh |