From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23304 invoked by alias); 2 Jun 2014 18:23:53 -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: 32678 Received: (qmail 12194 invoked from network); 2 Jun 2014 18:23: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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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= X-Sasl-enc: fH7eqRsplLwI84Pyj89dqoYN8K4xytEY5yBt/N7gU9ZK 1401733430 Date: Mon, 2 Jun 2014 18:23:46 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: (Y) modifier: up to N matches? Message-ID: <20140602182346.GB1858@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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?