From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3765 invoked by alias); 1 Oct 2016 14:34:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39533 Received: (qmail 15900 invoked from network); 1 Oct 2016 14:34:36 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi0-f68.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.218.68):SA:0(0.3/5.0):. Processed in 0.338302 secs); 01 Oct 2016 14:34:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_PASS,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: phy1729@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.218.68 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=m51JQ8mgsUPIYArbb8YcuvZtxk3JIf3E9fpYhj1KL1E=; b=QNHzcwi6po9210VilQCO24N+nTB53M3W1wt4o2bArWoWz4GWPCa2gljxCq5/0j2EBI mTU2oW1k2DmCkJIK3qnV7u02BdUU/qHFS8kxVhzD0TJF1lfmp0FtRzrWEMP+dAy+aol2 5dUpWhghjTr9JXYnJ0DMJqdOE1JhEfeNU6A9Iub4oGNIRwpjXfLk5wLW/gzE20LkMp0H zE19u6R/YTF6x70bYeFE3nPVbD3UTJNs0tIsIXaWvHsQNXGBlfkDUxBWpIGqVUYcvVxH WGUB7eE5JAfP72I6AdbDFt8ZfkS8o9+a/PJL7RysLt333k0n5tTRjrnKFk5mwj8uo5Qe g80A== X-Gm-Message-State: AA6/9RlKJPylD+SCOlDkTBFTJCgS0JWmcL4WWj9OVw2Dc5x1duVPVJe3tr2ItMGNZO/v0Q== X-Received: by 10.202.169.199 with SMTP id s190mr5709383oie.144.1475332471365; Sat, 01 Oct 2016 07:34:31 -0700 (PDT) Date: Sat, 1 Oct 2016 09:34:30 -0500 From: Matthew Martin To: zsh-workers@zsh.org Subject: Re: PATCH: doas completion Message-ID: <20161001143430.GA62977@CptOrmolo.darkstar> Mail-Followup-To: zsh-workers@zsh.org References: <80164.1475219190@hydra.kiddle.eu> <20161001143106.GA11445@CptOrmolo.darkstar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161001143106.GA11445@CptOrmolo.darkstar> User-Agent: Mutt/1.6.2 (2016-07-01) 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 }'