On 01/13/2011 07:59 AM, Philipp Thomas wrote:
> * Jim Meyering (j...@meyering.net) [20110113 08:53]:
> 
>>> * Add --suffix [suffix] to enable suffix killing (using
>>>   SUFFIX as the 2nd arg will no longer work going forward)
> 
> Using SUFFIX as the second argument IMO has to keep working as otherwise
> you'll break tons of scripts!

That's the whole point of the BSD -a/-s options, and extensible to our
proposal for --files0-from.

basename str1 str2: POSIX behavior (str2 is suffix)
basename -a str1 str2: filter behavior, print basenames of both str1 and
str2 without suffix
basename -s suffix: filter mode, reads from stdin, and chops suffix
basename: filter mode, reads from stdin
basename -s str2 str1: explicit suffix, same as basename str1 str2
basename -s suffix str1 str2: filter behavior, print basenames of both
str1 and str2 without suffix
basename -a -s suffix str1 str2: same (-a is only required for exactly
two arguements, and is implied for 0 or for more than 2 args)
basename --files0-from=file -s suffix: filter mode, input is NUL rather
than newline terminated, so output is NUL terminated as well

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to