Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[RFC PATCH v2 3/3] _setpriv: complete multiple --dump with argument states
- X-seq: zsh-workers 48211
- From: Arseny Maslennikov <ar@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Arseny Maslennikov <ar@xxxxxxxxx>
- Subject: [RFC PATCH v2 3/3] _setpriv: complete multiple --dump with argument states
- Date: Sun, 21 Mar 2021 16:01:31 +0300
- Archived-at: <https://zsh.org/workers/48211>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/20210321130131.1667276-3-ar%40cs.msu.ru>
- In-reply-to: <20210321130131.1667276-1-ar@cs.msu.ru>
- List-id: <zsh-workers.zsh.org>
- References: <20210321130131.1667276-1-ar@cs.msu.ru>
---
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