From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19016 invoked by alias); 11 Oct 2014 09:51:48 -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: 33432 Received: (qmail 16001 invoked from network); 11 Oct 2014 09:51:44 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1413020782; bh=sVf4sBdVW/KvYtKgP0eIAQ3z//v1+Rqq3jvZUxBqgxc=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:cc:In-reply-to:From:References:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=QrAQtIsSEK5XiRTHPcsi+SkPEbp33ZgXlCtHRoYbz5Ji0L9VLKvLagArwozslnVL0ZkAwzQfm2PUkWXlZxh75he+eQhQGnYTgoxXcPf/ZoM1CvvwYalb6THrECsi+cJRi7aNMQxKp2Fp9MULt8SgD4Iafv/klfAjkCVkeDJDl7Q= X-Yahoo-Newman-Id: 859587.36922.bm@smtp113.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ILjUPN4VM1lnttVURrOcb7CNWgqnZL5pl5h7kpuRmHHVRDD 6w4CFCYOGIxhTgxJg_OWwdyYSmGlnqQyNYkpGh8B8JeFX2.RYC6Hp7tEIDGA kLwT_d9GrqUiDmNEGpjdyjDz34a1sRWXj12q6964NhaUhS.TXDSdOmpwOfTS S7wrb.MWwnmNSeZCjr993tSbbK_aaFPlrCiiaEHT5xBA6S1lwfFL5AamvktR gMtvtnj4q7ixT6IKttGMsNZoDlNVDBcaIiclYWZW8jxUx3Ciiaqm27Qh9hi0 ENJnCLN8EoQjiX0ATIk54BtyQEKg6nGjWMhVSYMNlj6Ieno9nrLC7oV_ztOG tU0SAFvFsXAUT9P9HiT2NTvhJnekd1lzuyWqcDx4iiBu5i9OC.greEATVZDE JCoSxTPMn8bQHZcdf7DhMwIlUjGgclqgTiZ3jkjUUFVZypCs7MdPoIRPg7e3 LX4RDJ93OwRP5oZD.tQ3N.xQ.s3umiXv8eHADdl1zMMRfHnpXlG1Fr9kh4OY ZYqe5ca9b0o7qL_BEo8a1fgTj6aVOHA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- cc: zsh-workers@zsh.org In-reply-to: <20141009082124.GC1737@tarsus.local2> From: Oliver Kiddle References: <20141008082016.GC1712@tarsus.local2> <30554.1412778907@thecus.kiddle.eu> <20141009082124.GC1737@tarsus.local2> To: Daniel Shahaf Subject: Re: [Bulk] Re: [PATCH] Add xxd completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11353.1413020781.1@thecus.kiddle.eu> Date: Sat, 11 Oct 2014 11:46:21 +0200 Message-ID: <11354.1413020781@thecus.kiddle.eu> Daniel Shahaf wrote: > Thanks for the review. [ snip ] > Done. As you may have noticed, I've now pushed _xxd. > > > +# TODO: xxd - should show '-x' and '-x:' differently - give visual hint that there's a required argument > > > > Unless I'm missing something, there's nothing xxd specific in that > > desire. Perhaps it should be considered for the general case. In many > > Yes, that's a general issue. For example, instead of: > -u -- user name > I would prefer: > -u + -- user name If you want to dig into the code, it should be possible to make _arguments do that: match descriptions can differ from the actual match. I'm not sure how useful it would really be in practice. It'd also need to allow for optional arguments, and cases where it is -u=USER or -uUSER. While I say it would be possible, it wouldn't be easy. > Incidentally, I ran into another general issue: > It wasn't immediately obvious to me, but I eventually realized the "-z" in the > output was caused by a stray file named "-z" (via the _files completion defined > for positional arguments). However, since the filename begins with a hyphen, > specifying it as "-z" won't work as intended. Perhaps "xxd -" should > offer "./-z" or "-- -z" (two words) as possible completions? The -- and ./ tricks won't work for all commands and aren't always necessary. We'd need to handle it in lots of functions. Files starting with a - are rare, and usually a mistake. Perhaps it'd be worth doing in _rm as much to see what it involves. Maybe _files should be cleverer, perhaps also putting the (-.) in globs by default too. > Done. 'xxd -grou' now DTRTs; however, 'xxd -g' gives me: > > % xxd -g > -groupsize -- specify the number of octets per group > > and the display doesn't change even if I press again. This seems odd: > why am I not offered both -g and -groupsize as possible completions? And if > "-groupsize" is offered in the message, why does pressing not complete > the command-line word to the one possible completion? It'll perhaps seem clearer if you set the format style with the descriptions tag, e.g: zstyle ':completion:*:descriptions' format '%B%d%b' You may also need this: zstyle ':completion:*' group-name '' This makes it clearer that you have two groups, one of which has no associated matches, just a heading. What subsequent tab presses does, depends a lot on your configuration. Oliver