diff options
Diffstat (limited to 'completions/_su')
-rw-r--r-- | completions/_su | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/completions/_su b/completions/_su index 9c0f59c1..1a03c8f7 100644 --- a/completions/_su +++ b/completions/_su @@ -8,34 +8,34 @@ if [[ $OSTYPE != *linux* ]]; then return fi -_su() # linux-specific completion -{ +_su() +{ # linux-specific completion local cur prev words cword split _init_completion -s || return case "$prev" in - -s|--shell) + -s | --shell) _shells return ;; - -c|--command|--session-command) + -c | --command | --session-command) local IFS=$'\n' compopt -o filenames - COMPREPLY=( $(compgen -d -c -- "$cur") ) + COMPREPLY=($(compgen -d -c -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - COMPREPLY=( $(compgen -u -- "$cur") ) + COMPREPLY=($(compgen -u -- "$cur")) } && -complete -F _su su + complete -F _su su # ex: filetype=sh |