diff options
author | Jérémy Compostella <jeremy.compostella@gmail.com> | 2012-03-04 20:00:36 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2012-03-07 12:59:00 +0000 |
commit | a3eb71a98fd195e52d335fb8d6bdc2a719cc2c88 (patch) | |
tree | 9e1d64ff718175b75422d71037adcb89cc86b9eb /tests/misc | |
parent | 4b4a465798a212925670cc4fef7610678d221d69 (diff) | |
download | coreutils-a3eb71a98fd195e52d335fb8d6bdc2a719cc2c88.tar.xz |
basename: support more than one argument
* src/basename.c (perform_basename): New function refactored from
main() that performs the basename work on a STRING, optionally
removes a trailing SUFFIX and outputs the result.
(main): Handle new options.
* doc/coreutils.texi (basename invocation): Mention new options.
* test/misc/basename: Add new options test cases.
* NEWS (New features): Mention it.
Diffstat (limited to 'tests/misc')
-rwxr-xr-x | tests/misc/basename | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/misc/basename b/tests/misc/basename index fefe58c79..d0ab57bf6 100755 --- a/tests/misc/basename +++ b/tests/misc/basename @@ -47,6 +47,10 @@ my @Tests = ['h', qw(///), {OUT => '/'}], ['i', qw(///a///), {OUT => 'a'}], ['j', qw(''), {OUT => ''}], + ['k', qw(aa a), {OUT => 'a'}], + ['l', qw(-a a b), {OUT => "a\nb"}], + ['m', qw(-s a aa ba ab), {OUT => "a\nb\nab"}], + ['n', qw(a-a -a), {OUT => 'a'}], ['1', qw(f.s .s), {OUT => 'f'}], ['2', qw(fs s), {OUT => 'f'}], ['3', qw(fs fs), {OUT => 'fs'}], |