Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no
	version=3.4.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:subject:message-id:references:mime-version
         :content-type:content-disposition:in-reply-to:user-agent;
        bh=npfWWWqfms/eUhxu/w9agw+NnMgA045tAMrmY6hA5XM=;
        b=aZMu3QTxCfylyplW+86p35T/jiuLAK7xGi8mLKGvzP2hjhF6XlK/wYwd9e2YuOZ58A
         9Kp4vbEwa1wZtnEXu0zFbFqaBsmS+eTfTq05eEUofHyd2ZEU3GK9NpKBIpYIKJbpiOG9
         siVGY2LpPrnJjUfxn6EsTxOAFEIn8sF0nqzCBK3jau5gmqaTbyQejQGU9XWCD15lKDZB
         6RDJFnicxCeMgwl7hRJ+E/9Nh04IfydlkxE3UEAlCkJ6aTC5sEG9jZtz3Vb7UIgX6tff
         xNAUCtY6pZ1bxRXDgBh1rqguYMCD0EPxwDg7V5TtbaYqNJD185Bi4Y1HQxp1PRkJS6kr
         hvqw==
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:cc:subject:message-id:references
         :mime-version:content-type:content-disposition:in-reply-to
         :user-agent;
        bh=npfWWWqfms/eUhxu/w9agw+NnMgA045tAMrmY6hA5XM=;
        b=MS2C1RqN2p7g1i/qax5v7OZSObGXeMj0vILJEDxKZZW0bgWKXhoByc2eT1V/GBr3nC
         sm/Z6/FbU20fMZfrRB7W4I4GCYQiQsBCWVcISslK6M0UIeIESkotwD0tIEieJv/ZhjoS
         TzUWwHoRy1pzJ0Q/9008nBAhaoBm9zFrUz0su21n4S/VUKoPlvlY5yqgph/bh5UYD06w
         0j3pDcAKUMhzzmmwAgKVo9AnAHMcGeyy6nVapH9taXUzu/iIho6/F9Kaasro7aBKkqpa
         Er4I+MnEwkXnFoYX762GdhD6+0Y0NmZY0eJCNV4MBdyJVA81iUEur11wZkIB3/GUk/tU
         1fcA==
X-Gm-Message-State: ALoCoQkvyP5S/+chbCQH9ofcrc5UVT7sIj7xaPo8oXQzX/Z1Iy9nEGIoZvAsQi0pt7LomN/ff0qZW6k4R3jsWj17C5lQ5CRfXw==
X-Received: by 10.182.24.37 with SMTP id r5mr99406987obf.77.1452660478262;
        Tue, 12 Jan 2016 20:47:58 -0800 (PST)
Date: Tue, 12 Jan 2016 22:47:56 -0600
From: Matthew Martin <phy1729@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [patch] _init_d add OpenBSD bits
Message-ID: <20160113044756.GA9030@CptOrmolo.darkstar>
References: <20160110190157.GA4187@CptOrmolo.darkstar>
 <20160113005734.GA24858@tarsus.local2>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20160113005734.GA24858@tarsus.local2>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Seq: zsh-workers 37599

On Wed, Jan 13, 2016 at 12:57:34AM +0000, Daniel Shahaf wrote:
> Matthew Martin wrote on Sun, Jan 10, 2016 at 13:01:57 -0600:
> > +  (( $+functions[_init_d_get_cmds] )) ||
> > +  _init_d_get_cmds() {
> > +    local -a cmds disabled
> > +
> > +    cmds=(start stop reload restart check)
> > +    disabled=(${${${(M)${(f)"$(< $script)"}:#rc_(${(~j:|:)cmds})=NO}#rc_}%=NO})
> 
> Enhancement idea: only populate $disabled if -f isn't on the command line.
> (This doesn't block the patch, in my opinion.)

-f overrides <daemon>_flags=NO for the start action like FreeBSD's
onestart. It doesn't override the rc_<action>=NO statements.
> 
> > +    echo ${cmds:|disabled}
> > +  }
> > +
> > +  flags=('-d[print debug information]' '-f[forcibly start the daemon]')
> >  else
> >    (( $+functions[_init_d_fullpath] )) ||
> >    _init_d_fullpath() {
> > @@ -90,4 +107,4 @@ cmds=( $(_init_d_get_cmds) ) || return
> >  (( $#cmds )) || zstyle -a ":completion:${curcontext}:commands" commands cmds ||
> >      cmds=(start stop)
> >  
> > -_sub_commands $cmds
> > +_arguments -s -A "-*" $flags "*:init.d command:_sub_commands $cmds"
> 
> Surely these should be single quotes around the last argument?

Indeed! I didn't realize _arguments parses it's arguments.

