aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2017-06-24 19:47:26 -0400
committerPádraig Brady <P@draigBrady.com>2017-08-28 23:22:28 -0700
commit65b7bf790c5600611d3420d94b7fde539e428f3d (patch)
treea392b4af1d4f27c3c21afcb018fddfb5600a20af
parentls: consistently quote symlink targets (diff)
downloadcoreutils-65b7bf790c5600611d3420d94b7fde539e428f3d.tar.gz
coreutils-65b7bf790c5600611d3420d94b7fde539e428f3d.zip
realpath: improve usage description for --relative-{to,base}
* src/realpath.c (usage): Explicitly say 'DIR' instead of 'FILE' for --relative-{to,base} parameters, to avoid giving the impression that regular files can be used as relative base. * doc/coreutils.texi (realpath): Same.
-rw-r--r--doc/coreutils.texi12
-rw-r--r--src/realpath.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8f1cb4c5f..06d065940 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -14113,22 +14113,22 @@ This is the default mode of operation.
@opindex --quiet
Suppress diagnostic messages for specified file names.
-@item --relative-to=@var{file}
+@item --relative-to=@var{dir}
@opindex --relative-to
@cindex relpath
-Print the resolved file names relative to the specified file.
+Print the resolved file names relative to the specified directory.
Note this option honors the @option{-m} and @option{-e} options
pertaining to file existence.
-@item --relative-base=@var{base}
+@item --relative-base=@var{dir}
@opindex --relative-base
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
+only when @var{file}s are descendants of @var{dir}. Otherwise output the
absolute file name. If @option{--relative-to} was not specified, then
-the descendants of @var{base} are printed relative to @var{base}. If
+the descendants of @var{dir} are printed relative to @var{dir}. If
@option{--relative-to} is specified, then that directory must be a
-descendant of @var{base} for this option to have an effect.
+descendant of @var{dir} for this option to have an effect.
Note: this option honors the @option{-m} and @option{-e}
options pertaining to file existence. For example:
diff --git a/src/realpath.c b/src/realpath.c
index 92d88c5a4..d4c159573 100644
--- a/src/realpath.c
+++ b/src/realpath.c
@@ -81,8 +81,8 @@ all but the last component must exist\n\
-L, --logical resolve '..' components before symlinks\n\
-P, --physical resolve symlinks as encountered (default)\n\
-q, --quiet suppress most error messages\n\
- --relative-to=FILE print the resolved path relative to FILE\n\
- --relative-base=FILE print absolute paths unless paths below FILE\n\
+ --relative-to=DIR print the resolved path relative to DIR\n\
+ --relative-base=DIR print absolute paths unless paths below DIR\n\
-s, --strip, --no-symlinks don't expand symlinks\n\
-z, --zero end each output line with NUL, not newline\n\
\n\