diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-30 13:40:35 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-30 13:40:35 +0000 |
commit | dc7f65410ff9df200f41246fd70bf688b32408d5 (patch) | |
tree | ee6617dcfe8bf547be6de46033e48aebab30f9d7 /usr.bin/basename/basename.1 | |
parent | 954ff8bf68f6fa0ade446e2c42c885d7e3068aa8 (diff) | |
download | FreeBSD-src-dc7f65410ff9df200f41246fd70bf688b32408d5.zip FreeBSD-src-dc7f65410ff9df200f41246fd70bf688b32408d5.tar.gz |
Make it possible to have this (basename(1)) perform basename(3) on multiple
files. The traditional behaviour, 'basename string .suffix', is preserved,
however a suffix may now also be specified via a getopt(3) option, -s, such
that if it is specified in that way, all string arguments follow. There is
also a new flag, -a, which allows a user to say "yes, please basename(3) on
all arguments". Update manual to reflect this unobtrusively.
Reviewed by: obrien
Diffstat (limited to 'usr.bin/basename/basename.1')
-rw-r--r-- | usr.bin/basename/basename.1 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.bin/basename/basename.1 b/usr.bin/basename/basename.1 index 66d06f5..d9feaf9 100644 --- a/usr.bin/basename/basename.1 +++ b/usr.bin/basename/basename.1 @@ -45,6 +45,11 @@ .Nm .Ar string .Op Ar suffix +.Nm +.Op Fl a +.Op Fl s Ar suffix +.Ar string +.Op Ar ... .Nm dirname .Ar string .Sh DESCRIPTION @@ -64,6 +69,19 @@ is not stripped if it is identical to the remaining characters in .Ar string . The resulting filename is written to the standard output. A non-existent suffix is ignored. +If +.Fl a +is specified, then every argument is treated as a +.Ar string +as if +.Nm +were invoked with just one argument. +If +.Fl s +is specified, then the +.Ar suffix +is taken as its argument, and all other arguments are treated as a +.Ar string . .Pp The .Nm dirname |