zsh-workers
 help / color / mirror / code / Atom feed
From: Arseny Maslennikov <ar@cs.msu.ru>
To: zsh-workers@zsh.org
Cc: Arseny Maslennikov <ar@cs.msu.ru>
Subject: [RFC PATCH v2 3/3] _setpriv: complete multiple --dump with argument states
Date: Sun, 21 Mar 2021 16:01:31 +0300	[thread overview]
Message-ID: <20210321130131.1667276-3-ar@cs.msu.ru> (raw)
In-Reply-To: <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



  parent reply	other threads:[~2021-03-21 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 13:01 [PATCH v2 1/3] Introduce new completion for Linux task capabilities Arseny Maslennikov
2021-03-21 13:01 ` [PATCH v2 2/3] Introduce new completion for setpriv(1) on Linux Arseny Maslennikov
2021-03-22 10:18   ` Mikael Magnusson
2021-03-21 13:01 ` Arseny Maslennikov [this message]
2021-03-27 16:28   ` [RFC PATCH v2 3/3] _setpriv: complete multiple --dump with argument states Lawrence Velázquez
2021-03-27 16:28 ` [PATCH v2 1/3] Introduce new completion for Linux task capabilities Lawrence Velázquez
2021-03-28 10:57   ` Oliver Kiddle
2021-03-29  6:38     ` Duplicated X-Seq? (was: Re: Re: [PATCH v2 1/3] Introduce new completion for Linux task capabilities) Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210321130131.1667276-3-ar@cs.msu.ru \
    --to=ar@cs.msu.ru \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).