diff options
Diffstat (limited to 'completions/groupmod')
-rw-r--r-- | completions/groupmod | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/completions/groupmod b/completions/groupmod index 5516d31..3e8a352 100644 --- a/completions/groupmod +++ b/completions/groupmod @@ -1,29 +1,31 @@ # groupmod(8) completion -*- shell-script -*- -_groupmod() +_comp_cmd_groupmod() { - local cur prev words cword split - _init_completion -s || return + local cur prev words cword was_split comp_args + _comp_initialize -s -- "$@" || return # TODO: if -o/--non-unique is given, could complete on existing gids # with -g/--gid + local noargopts='!(-*|*[gnp]*)' + # shellcheck disable=SC2254 case $prev in - --gid | --help | --new-name | --password | -!(-*)[ghnp]) + --gid | --help | --new-name | --password | -${noargopts}[ghnp]) return ;; esac - $split && return + [[ $was_split ]] && return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + _comp_compgen_help [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g } && - complete -F _groupmod groupmod + complete -F _comp_cmd_groupmod groupmod # ex: filetype=sh |