From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55 invoked by alias); 6 Dec 2010 15:37:05 -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: 15619 Received: (qmail 3740 invoked from network); 6 Dec 2010 15:36:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=3JdS/DRpsQzjybuOTezf87IpIChwE14b4alLT8CYRE4=; b=Y7t7jnxE5nLV+p0jz7Ho0zqBwJnLlvf5aaJFrGRU/YEBynvpsFo3OrApxbeuegykdL nxKJgjOXqamZzd4zNaZ/duwGNCaZ/9PgTaoH76M9H5UAhM3wnwpxra2Thl1dpowxW47t q7V3nb2T1YsSaP2OelrYw1mZjeOaHKYsJ3q/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=m4LI3sfD9a1u1ssc3/E8kqdsjRjWBipPycT+SXGQT+Oz/qxXN0khYLGPayGED/XYT3 /Coc9eAYUYCam4dBqaNWKe0WcuWKJxRZtE9PX2wEdqFhn6eLDEpUrf7NwTTueSGCWCqp 56uaQCL5FSnAywE+yTKHg4JePL4aO3PgrL3EQ= MIME-Version: 1.0 In-Reply-To: <20101206151124.389fd287@pwslap01u.europe.root.pri> References: <201012061512.21791.mrichter@theory.phy.tu-dresden.de> <20101206151124.389fd287@pwslap01u.europe.root.pri> From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Mon, 6 Dec 2010 16:31:11 +0100 Message-ID: Subject: Re: Using the same completion function for various commands To: Peter Stephenson Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2010/12/6 Peter Stephenson : > On Mon, 6 Dec 2010 16:03:51 +0100 > Mikael Magnusson wrote: > >> 2010/12/6 J=C3=A9r=C3=A9mie Roquet : >> > Hi, >> > >> > 2010/12/6 Mikael Magnusson : >> >> You can also do this in your .zshrc instead of in the completer if >> >> you wish, just write >> >> compdef _foo -p 'foo_*' >> >> >> >> At least that's what the documentation says, it doesn't seem to >> >> work that well. >> > >> > It works fine for me with 4.3.10, did I miss something? >> >> When i tried compdef _du -p foo_\*, i only got single-letter options >> completed. >> > > That means it's working perfectly. =C2=A0It's hitting this line at the to= p of > _du > > =C2=A0_pick_variant gnu=3DFree\ Soft unix --version /dummy/no-such-file > > and deciding, quite reasonably in my opinion, that foo_\* is not a GNU > variant of du. =C2=A0So it's going to the other branch, where the options= are > simpler. I'm getting some weird behaviour with some commands, though. For example : $ aap - -- -- end of options, targets and assignments foll= ow --changed -- consider specified file changed --command -c -- execute a command after reading the recipe --contents -C -- only build when file contents changed $ compdef _aap bar $ bar - -- -- end of options, targets and assignments foll= ow --changed -- consider specified file changed --command -c -- execute a command after reading the recipe --contents -C -- only build when file contents changed $ compdef _aap -p baz $ baz - zsh: do you wish to see all 1152 possibilities (1154 lines)? option -- --changed --command --contents -c -C -k -- end of options, targets and assignments follow -- consider specified file changed -- execute a command after reading the recipe I guess there is something wrong in _aap, but I don't understand why the behaviour is different with and without the -p Best regards, --=20 J=C3=A9r=C3=A9mie