From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3154 invoked by alias); 9 Jun 2016 15:50:32 -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: 38641 Received: (qmail 29851 invoked from network); 9 Jun 2016 15:50:31 -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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1465487024; bh=KDVFL/Y35fVx78Y/nrUCj5SOR14/X/J+vqgCp/g0QvY=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=W/zF8a/ZKDz9I+gTL0aL8tlWQjOjAWEhldXSSsoRKFKftOsdqRoq3h2Bn6lRBFp01ikF1ni8phXxTkmWARhoNX18dwS7vcDyrmM0a2YZQve6xGNKz7Ohxe5Ozn+5jC7z3y+7aEWbNLnYL0tYic4zAy7KDhUDVxq1VNJ7Nk6YZYkYKMhgL6oR6qq/cZ/dQZqpDn4vLVNTbuK0ZAwbCAhvyjoi4uaLLbJcSp5auZWv+JOabkyKZeti7TFmWDw6aotgdBSD7k2A30IPUFzu9hilIP0mMFLr2fUUOqhSkzHePzu/UNZYgo3uu6w+7ZpgdzDt7UMSfRNHrcg5kfYBXKEcyw== X-Yahoo-Newman-Id: 297847.57214.bm@smtp136.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: LDTgrvsVM1lY7lBYFEfOWlQ9Dba5h0yD08XUdvMtum4VHbg sZ9KbbgYf2nW.vtt5Uk_wAlbwjerJL7eHmszaHGSgrSUosc2x76d_3ucsNQm ayr9dExrc9oCy7eYdaFyROFeKwDERHSnQItYLQb7FGubhVTQxYqk.xJoMGFK oM8cBxlpUeG7BBDvGF2qcY8A.OjablXrgayReuH6T5zHbvG2Yi_ujJnk_ekP E0vpWn_._GUYtJWd1DdfH36XY37JKGnIx6wIY8fbrV7ih7kJs3FQx3CV_Di4 monUqttguIQ2bo1MPLezVd4l_8qrj1VFZjphmfReD0JOdWHmHVCGqx7kRxoH sCBnw71AmvZp3WnYdkoV2YONQLUvxEhCt3nJ3BRnrpAEIlbc7SehF95Wnb_N TpGm0ltxeIxF5oZyAatkhmcMapha1sGj9VNkyjL6536bITmt5Er_7iLCdQ2w ZMqIvZiqZt_Q3rNAq8evcW5BZExMRqnBlVAjeXItIoPhQuOh32eKZDlcR2fn vtSiyUBUJxursElwigTW7HXGYPjkYhQ-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <57596005.3070100@redhat.com> From: Oliver Kiddle References: <57596005.3070100@redhat.com> To: zsh workers Subject: Re: _values and end of options MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2448.1465487019.1@thecus.kiddle.eu> Date: Thu, 09 Jun 2016 17:43:43 +0200 Message-ID: <2450.1465487023@thecus.kiddle.eu> Marko Myllynen wrote: > > Otherwise this works nicely (each of the options is completed only once) > but -1 -2 are missing from offered options (see _values). I can use -- > to have them included as well (_values -w opts -- $opts) but then -- is > also offered. _values starts with a call to zparseopts to remove normal compadd style options such as -1 and -2. In general these shouldn't occur after (or mixed with) the values. It mostly occurs when _values is used within an _arguments spec. In that case the unwanted options only appear at the beginning. The following patch makes it only remove compadd style options that occur at the beginning. > Can _values be used reliably in cases where there might be options as > values? Or is there a better way to achieve this with compadd or such > for the above case? Well, normally you'd use _arguments for options but I assume you have some reason for not doing that. _values should work but may have some differences - like not checking the prefix-needed style. Oliver diff --git a/Completion/Base/Utility/_values b/Completion/Base/Utility/_values index ab0e46a..c510b4c 100644 --- a/Completion/Base/Utility/_values +++ b/Completion/Base/Utility/_values @@ -3,7 +3,7 @@ local subopts opt usecc garbage subopts=() -zparseopts -D -E -a garbage C=usecc O:=subopts M: J: V: 1 2 n F: X: +zparseopts -D -a garbage C=usecc O:=subopts M: J: V: 1 2 n F: X: (( $#subopts )) && subopts=( "${(@P)subopts[2]}" )