summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/realpath.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/realpath.c b/src/realpath.c
index 19727641a..f95535b12 100644
--- a/src/realpath.c
+++ b/src/realpath.c
@@ -330,10 +330,7 @@ main (int argc, char **argv)
}
if (relative_base && !relative_to)
- {
- error (0, 0, _("--relative-base requires --relative-to"));
- usage (EXIT_FAILURE);
- }
+ relative_to = relative_base;
bool need_dir = (can_mode & CAN_MODE_MASK) == CAN_EXISTING;
if (relative_to)