Eric, now that I've got the prereqs in place, built coreutils from git successfully, and read the coreutils HACKING file, let's make sure I am on your page:
In no order: * Snarf getopt_long arg processing from wc.c or other you mentioned * Add --filter (combined with the lack of file args) to handle processing of stdin * Add --files-from0 per wc.c code (found it there) * Add --suffix [suffix] to enable suffix killing (using SUFFIX as the 2nd arg will no longer work going forward) * Update usage() obviously Correct? Anything else? On 1/12/2011 2:02 PM, Eric Blake wrote:
On 01/12/2011 11:43 AM, Jeff Blaine wrote:I was surprised to find this today. The following fails: echo /some/place/foo.txt | basename This also fails: find /somewhere -print | xargs basename This *does* work though, somehow, when the above does not: echo /some/place/foo.txt | xargs basename What is going on here? dirname is the same way.POSIX requires that basename and dirname be passed arguments; they are not required to run as filters. That said, it would be awesome if someone would contribute the patches to emulate the BSD extensions of: basename [-a] [-s suffix] string [...] From there, it's not much harder to implement extensions that 0 arguments is an extension to operate in filter mode (although we may want to require the use of basename --filter to make it obvious, and we would certainly want basename --files-from0 to operate on find -print0 output). But someone has to contribute the patch - are you willing?
