zsh-workers
 help / color / mirror / code / Atom feed
* (Y) modifier: up to N matches?
@ 2014-06-02 18:23 Daniel Shahaf
  2014-06-03  3:46 ` Bart Schaefer
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel Shahaf @ 2014-06-02 18:23 UTC (permalink / raw)
  To: zsh-workers

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?


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-06-06  4:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-02 18:23 (Y) modifier: up to N matches? Daniel Shahaf
2014-06-03  3:46 ` Bart Schaefer
2014-06-04  2:08   ` [PATCH] " Daniel Shahaf
2014-06-04  6:01     ` Mikael Magnusson
2014-06-04  6:54       ` Bart Schaefer
2014-06-04  6:42     ` Bart Schaefer
2014-06-04  9:25       ` Peter Stephenson
2014-06-04 23:08       ` Daniel Shahaf
2014-06-04 23:16         ` Bart Schaefer
2014-06-05  4:45           ` Bart Schaefer
2014-06-05 23:24           ` Oliver Kiddle
2014-06-06  2:20             ` Bart Schaefer
2014-06-06  2:40               ` Daniel Shahaf
2014-06-06  2:45             ` Daniel Shahaf
2014-06-06  4:24               ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).