From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21666 invoked by alias); 2 Dec 2011 13:19:55 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16594 Received: (qmail 22968 invoked from network); 2 Dec 2011 13:19:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at altlinux.org does not designate permitted sender hosts) Date: Fri, 2 Dec 2011 17:14:18 +0400 From: "Alexey I. Froloff" To: zsh-users@zsh.org Subject: Q: _regex_arguments problem Message-ID: <20111202131418.GA18623@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-12-30) --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! A have complex completion written on top or _regex_words/_regex_arguments functions. This looks like: =3D=3D=3D8<=3D=3D=3D #compdef fubar _fubar_variants() { local -a variants variants=3D( 'one' 'two' 'three' 'four' ) _describe -t vatiant-id 'variant id' variants -V variants } local -a args reply args=3D( # Command word. Don't care what that is. /$'[^\0]#\0'/ ) local -a variant_any_id_arg variant_any_id_arg=3D( /$'[^\0]##\0'/ ':variant-id:variant id:_fubar_variants' ) local -a opt_args _regex_words \ fubar-options "fubar options" \ '--variants:variants list:$variant_any_id_arg' args+=3D( '(' "$reply[@]" '|' ')' ) _regex_arguments _fubar "${args[@]}" _fubar "$@" =3D=3D=3D>8=3D=3D=3D I want to complete --variants option argument as a comma-separated list of variants, like fubar --variants one,two,four The only example of _regex_words/_regex_arguments usage is ip(8) completion, but it doesn't use such syntax. Is it possible at all? _fubar_variants function is also used where exactly one variant is required, so I'd rather not to change it. P.S. I'm not offering this completion to main tree because this is a completion for special service only used in ALT Linux - http://en.altlinux.org/Git.alt_reference I uses complex context-based syntax (just like ip(8)!), so I decided to use _regex_words/_regex_arguments. --=20 Regards, -- Sir Raorn. --- http://thousandsofhate.blogspot.com/ --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJO2M8lAAoJEErPkC6vOrpJRFwP/0NXtDGELI4DFzskgrfjUkMv SLR0s5DtKglnwz9QTT47VfHDwJPwtk5VJ+UleujIr953DelYYxRa2TcC2QTW/tJR Z8oLL8Oj8z/Ma5CIIwhoQB7jjpXO1pziz6V1dbrsIdjojmUO/a9vfEHyShyGqJnL vAA41oAHoNDIhmqqHd7/g1jSxvHq1UdQvpZoe0VaTFlHvNnKdPpd92PrRF+mhMxt xI3Q+K8d+FiRZlvz5wg17PZv+Zh+OOBXs1A4qVT6o3/jRD57w2evcm8EKJFTb/j9 kjwOxoB4uMINtJfjx2ly24INPsdCWNhqGV8hZj7ILzzm2K3y3pwLHGju53BHLqtD F8IMU1ueMKi01Fq2Tt+kJ71M8B2MdKR1Uo5fsaU/JqSAtM2ViW+X1AIIWZ8/dFVk p7srd/6nIEofpDrP27TjssLEQ9xPzoXLOCGXUpOP86T9i7GIH/hc9ncYtEbfSNVa m0egsqFPjGVv+6OxDgRqSm2ZMI8xlQkczPoFKXlfP77FaceCqbEQ7xQ4dk5NU+a3 /WkxXpT6Vm+/FudDmyF1Sq+xaBfml8wrKcGjtxPLIodDzi+WqRuYXwc9/8omZbGw /nI4I36SwwyPd/wa1U43kcQYykfyZkT6nWquIG4lvHTPJ5UdzYBwrfI0okNClABi ccdaUkE3Ome9Of5c8AFK =FgGo -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4--