From 9f5aa4850133976eee22dcc0b506d7b632cd674c Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 14 Mar 2012 13:42:59 -0600 Subject: 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. --- src/realpath.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') 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) -- cgit v1.2.3-54-g00ecf