From: Matthew Martin <phy1729@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: PATCH: doas completion
Date: Sat, 1 Oct 2016 09:34:30 -0500 [thread overview]
Message-ID: <20161001143430.GA62977@CptOrmolo.darkstar> (raw)
In-Reply-To: <20161001143106.GA11445@CptOrmolo.darkstar>
On Sat, Oct 01, 2016 at 09:31:06AM -0500, Matthew Martin wrote:
> On Fri, Sep 30, 2016 at 09:06:30AM +0200, Oliver Kiddle wrote:
> > Much of this is just cut and paste from _sudo.
> > I think the -a option might be OpenBSD specific: once things settle down
> > with a single portable doas implementation instead of the current state
> > of there being several then that can be cleaned up.
> >
> > Oliver
>
> I've had an alternate version sitting in my tree for a while. Merging
> the two I get the below. Changes are adding -A '-*' to _arguments,
> adding the -L option, sorting options, and ignoring * with -s. I had it
> in BSD, but I suppose it's been ported elsewhere now.
>
> - Matthew Martin
Should have pulled first. Diff on top of master.
- Matthew Martin
diff --git a/Completion/Unix/Command/_doas b/Completion/Unix/Command/_doas
index 5c26b1d..b36388e 100644
--- a/Completion/Unix/Command/_doas
+++ b/Completion/Unix/Command/_doas
@@ -9,10 +9,13 @@ do local -x "$e"
done
cmd="$words[1]"
-_arguments -s -S \
+_arguments -s -S -A '-*' : \
+ - optL \
+ '-L[clear any persisted authorizations]' \
+ - default \
+ '-a+[specify authentication style]:authentication style' \
'(-n -s)-C+[check config file and report on command matching]:config:_files' \
'(-C)-n[non-interactive: fail rather than prompt for a password]' \
- '-a+[specify authentication style]:authentication style' \
- '(-C)-s[run a shell]' \
+ '(-C *)-s[run a shell]' \
'-u+[run command as specified user]:user:_users' \
'*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[-u]} ) ; _normal }'
prev parent reply other threads:[~2016-10-01 14:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 7:06 Oliver Kiddle
2016-10-01 14:31 ` Matthew Martin
2016-10-01 14:34 ` Matthew Martin [this message]
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=20161001143430.GA62977@CptOrmolo.darkstar \
--to=phy1729@gmail.com \
--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).