summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-03-14 13:42:59 -0600
committerEric Blake <eblake@redhat.com>2012-03-15 12:24:05 -0600
commit9f5aa4850133976eee22dcc0b506d7b632cd674c (patch)
tree868db0dba0e6b8dee1769deefe0417eae641571c /doc
parent61167bae9f27269724dc577a19d2bd48a437bafb (diff)
downloadcoreutils-9f5aa4850133976eee22dcc0b506d7b632cd674c.tar.xz
realpath: let --relative-to default to --relative-base
Most of the time, if someone wants to filter which paths are relative while leaving all others absolute, they also want to to the filtering based on the same --relative-to directory. Make this easier to specify. * src/realpath.c (main): Convert error to default. * doc/coreutils.texi (realpath invocation): Document this. * tests/misc/realpath: Adjust test to match. * NEWS: Document it.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 39c9bbf67..835c245d4 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12904,14 +12904,16 @@ pertaining to file existence.
This option is valid when used with @option{--relative-to}, and will restrict
the output of @option{--relative-to} so that relative names are output,
only when @var{file}s are descendants of @var{base}. Otherwise output the
-absolute file name. Note: this option honors the @option{-m} and @option{-e}
+absolute file name. If @option{--relative-to} was not specified, then
+the descendants of @var{base} are printed relative to @var{base}.
+Note: this option honors the @option{-m} and @option{-e}
options pertaining to file existence. For example:
@example
realpath --relative-to=/usr /tmp /usr/bin
@result{} ../tmp
@result{} bin
-realpath --relative-base=/usr --relative-to=/usr /tmp /usr/bin
+realpath --relative-base=/usr /tmp /usr/bin
@result{} /tmp
@result{} bin
@end example