summaryrefslogtreecommitdiffstats
path: root/completions/vipw
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--completions/vipw18
1 files changed, 10 insertions, 8 deletions
diff --git a/completions/vipw b/completions/vipw
index b3a7415..bfaa48a 100644
--- a/completions/vipw
+++ b/completions/vipw
@@ -1,22 +1,24 @@
# vipw(8) and vigr completion -*- shell-script -*-
-_vipw()
+_comp_cmd_vipw()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
+ local noargopts='!(-*|*[R]*)'
+ # shellcheck disable=SC2254
case $prev in
- --help | -!(-*)h)
+ --help | -${noargopts}h)
return
;;
- --root | -!(-*)R)
- _filedir -d
+ --root | -${noargopts}R | -d)
+ _comp_compgen_filedir -d
return
;;
esac
- COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
+ _comp_compgen_help || _comp_compgen_usage
} &&
- complete -F _vipw vipw vigr
+ complete -F _comp_cmd_vipw vipw vigr
# ex: filetype=sh