summaryrefslogtreecommitdiffstats
path: root/completions/passwd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--completions/passwd18
1 files changed, 10 insertions, 8 deletions
diff --git a/completions/passwd b/completions/passwd
index 652a41e..b34a1e7 100644
--- a/completions/passwd
+++ b/completions/passwd
@@ -1,24 +1,26 @@
# passwd(1) completion -*- shell-script -*-
-_passwd()
+_comp_cmd_passwd()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
+ local noargopts='!(-*|*[nxwi]*)'
+ # shellcheck disable=SC2254
case $prev in
- --minimum | --maximum | --warning | --inactive | --help | --usage | -!(-*)[nxwi?])
+ --minimum | --maximum | --warning | --inactive | --help | --usage | \
+ -${noargopts}[nxwi?])
return
;;
esac
if [[ $cur == -* ]]; then
- local opts=$(_parse_help "$1")
- COMPREPLY=($(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur"))
+ _comp_compgen_help || _comp_compgen_usage
return
fi
- _allowed_users
+ _comp_compgen_allowed_users
} &&
- complete -F _passwd passwd
+ complete -F _comp_cmd_passwd passwd
# ex: filetype=sh