diff options
Diffstat (limited to '')
-rw-r--r-- | completions/gpasswd | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/completions/gpasswd b/completions/gpasswd index f1f2200..db33c29 100644 --- a/completions/gpasswd +++ b/completions/gpasswd @@ -1,25 +1,27 @@ # gpasswd(1) completion -*- shell-script -*- -_gpasswd() +_comp_cmd_gpasswd() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return + local noargopts='!(-*|*[adAM]*)' + # shellcheck disable=SC2254 case $prev in - --add | --delete | --administrators | --members | -!(-*)[adAM]) - COMPREPLY=($(compgen -u -- "$cur")) + --add | --delete | --administrators | --members | -${noargopts}[adAM]) + _comp_compgen -- -u return ;; esac if [[ $cur == -* ]]; then # TODO: only -A and -M can be combined - COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + _comp_compgen_help return fi - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g } && - complete -F _gpasswd gpasswd + complete -F _comp_cmd_gpasswd gpasswd # ex: filetype=sh |