Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: doas completion
- X-seq: zsh-workers 39533
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: doas completion
- Date: Sat, 1 Oct 2016 09:34:30 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=m51JQ8mgsUPIYArbb8YcuvZtxk3JIf3E9fpYhj1KL1E=; b=em8kv9CrNF6MbVVA/1zSHrqlcZ9TCa5zz5pT/1JqGidQek1avhrbJY6rOrMKHxHOyq UvWWft9QVYNUGGqSz6CQFDBNDO4Bjosnxidjgo1zzgRyeB4/MVjxE1B7oS3nq6/I85lF ENdJRWGVc5TbEmfoj5GeEgaR+cMoQ1OaSWmBkpNfhCd7LzkLKM6hTwI0GOc4PYPmOlok Y34ulHR+bQ4LGgjTnVyARVnN7wdDjv3gx1NKaBbCsJbDGQ7wroeE+t32jqFEhcFg6HWd okKSNWVdCBOCu9WzzkiTRuRAfRTbacBaTP1rnVbxe6E+cmkRvSJuUQax41+gqNrPHkiw qUcw==
- In-reply-to: <20161001143106.GA11445@CptOrmolo.darkstar>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <80164.1475219190@hydra.kiddle.eu> <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 }'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author