Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[RFC PATCH v2 3/3] _setpriv: complete multiple --dump with argument states



---
 Completion/Linux/Command/_setpriv | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/Completion/Linux/Command/_setpriv b/Completion/Linux/Command/_setpriv
index f42e02cc8..d6fe428ba 100644
--- a/Completion/Linux/Command/_setpriv
+++ b/Completion/Linux/Command/_setpriv
@@ -72,10 +72,10 @@ __setpriv_death_signals() {
 local curcontext="$curcontext" state state_descr line
 typeset -A opt_args
 
-_arguments -C -S \
+_arguments -C -S -s \
   '(- : *)'{-h,--help}'[print help and exit]' \
   '(- : *)'{-V,--version}'[print version information and exit]' \
-  '(- : *)*'{-d,--dump}'[display the current privilege state]' \
+  '(- : *)'{-d,--dump}'[display the current privilege state]:*: :->option-dump' \
   '(--groups --init-groups --keep-groups)--clear-groups[clear supplementary groups]' \
   '(--clear-groups --init-groups --keep-groups)--groups[set supplementary groups]: : _sequence _groups' \
   '(--clear-groups --groups --init-groups)--keep-groups[preserve supplementary groups]' \
@@ -97,4 +97,11 @@ _arguments -C -S \
   '--apparmor-profile[request an apparmor profile]:AppArmor profiles: ' \
   '--reset-env[set environment as for a classic login shell]' \
   '*:::command:_normal' \
-  #
+  && return 0
+
+case $state in
+  option-dump)
+      _arguments -S '*'{-d,--dump}'[display the current privilege state]'
+      ;;
+  *) ;;
+esac
-- 
2.31.0





Messages sorted by: Reverse Date, Date, Thread, Author