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