Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
(Y) modifier: up to N matches?
- X-seq: zsh-workers 32678
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: (Y) modifier: up to N matches?
- Date: Mon, 2 Jun 2014 18:23:46 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id :mime-version:content-type; s=mesmtp; bh=Bxr3MW97j2v8OgP0pKpRfDD RI0A=; b=cUkZCKUzeWfeMOj951t9Xvxx/zVRBK04qQaE7jUiVRUwsN8rRmiFnND FJIKflNlchHcwbnGpcyIdfj+RCYY1X5AFwqY0sl1GwrHMRq/ckMRitZ6r566K0K8 S7o5+ynjjDh1op5+G2zAH3GotprGf7gXQyDKGURMF6b4zNIHOXog=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :mime-version:content-type; s=smtpout; bh=Bxr3MW97j2v8OgP0pKpRfD DRI0A=; b=UfaaG48SpVy05X3sY4qo/yFS+3FI3yEDRChzPcHwsBBZVrcHwukzCL 5Aqatael6cfOwGD9/Ca1BaRPxaaNhZQCqnIFMGI1nfZTv5eBvw4qqAHBxDFkX3PF C53WoV+z4gInCbH1DyzZqxEqsB0h2t9vF0u1bRiuOUHKROhN5xo4E=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Right now, *(NY) expands to either zero or one filenames.
Would it make sense to have (Y) take a numeric argument specifying the maximal
number of files to match? e.g., *(NY5) would expand to between 0 and 5
filenames (but never more than 5).
I think it will be a small code change (just check matchct when deciding
whether to return) and will work nicely with other qualifiers (eg sorting)
without special effort. It would be a superset of the current functionality
[(NY1) would be equivalent to the current (NY)].
I imagine it would be useful in cases where 'find | head' or 'grep | head' are
useful.
Thoughts?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author