diff options
author | Jérémy Compostella <jeremy.compostella@gmail.com> | 2012-03-09 19:21:42 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2012-03-10 19:53:06 +0000 |
commit | 57c929da8bbc297249dadc560e8e3a569b0d685d (patch) | |
tree | f68334475ff3975f3ea179ea92935ef3b00de5ab /doc | |
parent | 7480e2db2935663b9c0c4d66418ce2801005792d (diff) | |
download | coreutils-57c929da8bbc297249dadc560e8e3a569b0d685d.tar.xz |
dirname: support more than one argument
* src/dirname.c (main): Handle new -z option and manage more than one
argument.
* doc/coreutils.texi (dirname invocation): Mention it.
* NEWS (New features): Mention it.
* tests/misc/dirname: Add a two arguments test.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index f9207e773..39c9bbf67 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -12514,13 +12514,13 @@ basename -a -s .h include/stdio.h include/stdlib.h @cindex stripping non-directory suffix @cindex non-directory suffix, stripping -@command{dirname} prints all but the final slash-delimited component of -@var{name}. Slashes on either side of the final component are also -removed. If the string contains no slash, @command{dirname} prints -@samp{.} (meaning the current directory). Synopsis: +@command{dirname} prints all but the final slash-delimited component +of each @var{name}. Slashes on either side of the final component are +also removed. If the string contains no slash, @command{dirname} +prints @samp{.} (meaning the current directory). Synopsis: @example -dirname @var{name} +dirname [@var{option}] @var{name}... @end example @var{name} need not be a file name, but if it is, this operation @@ -12534,8 +12534,17 @@ including the case when the final component is itself a directory. result is @samp{//} on platforms where @var{//} is distinct from @var{/}, and @samp{/} on platforms where there is no difference. -The only options are @option{--help} and @option{--version}. @xref{Common -options}. +The program accepts the following option. Also see @ref{Common options}. + +@table @samp + +@item -z +@itemx --zero +@opindex -z +@opindex --zero +Separate output items with @sc{nul} characters. + +@end table @exitstatus @@ -12546,6 +12555,9 @@ Examples: dirname /usr/bin/sort dirname /usr/bin//.// +# Output "dir1" followed by "dir2" +dirname dir1/str dir2/str + # Output ".". dirname stdio.h @end smallexample |