summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-03-23 14:48:19 -0600
committerEric Blake <ebb9@byu.net>2009-03-25 06:33:32 -0600
commit9b4aa5e268da5980f63a1c47c2cd7ba04ad4a394 (patch)
tree2b8b6e75d23599bd87a601fc8117284e94cf3f20 /doc
parent53191d01e23d05f42d0d90abe07b18aae7c50b3a (diff)
downloadcoreutils-9b4aa5e268da5980f63a1c47c2cd7ba04ad4a394.tar.xz
pwd: support -L and -P
* src/pwd.c (longopts): New variable. (logical_getcwd): New function. (main): Use it. (usage): Document new options. * doc/coreutils.texi (pwd invocation): Likewise. * NEWS: Likewise. * TODO (pwd): Mark it done. * tests/misc/pwd-option: New file. * tests/Makefile.am (TESTS): Add test. * THANKS: Update. Reported by Paul D. Smith, in savannah bug 24949.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi38
1 files changed, 32 insertions, 6 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 9c8b8c3a6..70effa1e8 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -11872,13 +11872,39 @@ so forth. See also the user-related commands in the next section.
@cindex current working directory, printing
@cindex working directory, printing
-@cindex symbolic links and @command{pwd}
-@command{pwd} prints the fully resolved name of the current directory.
-That is, all components of the printed name will be actual directory
-names---none will be symbolic links.
-The only options are a lone @option{--help} or
-@option{--version}. @xref{Common options}.
+@command{pwd} prints the name of the current directory. Synopsis:
+
+@example
+pwd [@var{option}]@dots{}
+@end example
+
+The program accepts the following options. Also see @ref{Common options}.
+
+@table @samp
+@item -L
+@itemx --logical
+@opindex -L
+@opindex --logical
+If the contents of the environment variable @env{PWD} provide an
+absolute name of the current directory with no @samp{.} or @samp{..}
+components, but possibly with symbolic links, then output those
+contents. Otherwise, fall back to default @option{-P} handling.
+
+@item -P
+@itemx --physical
+@opindex -P
+@opindex --physical
+Print a fully resolved name for the current directory. That is, all
+components of the printed name will be actual directory names---none
+will be symbolic links.
+@end table
+
+@cindex symbolic links and @command{pwd}
+If @option{-L} and @option{-P} are both given, the last one takes
+precedence. If neither option is given, then this implementation uses
+@option{-P} as the default unless the @env{POSIXLY_CORRECT}
+environment variable is set.
@mayConflictWithShellBuiltIn{pwd}