From 638a66c8ff8c71f5b3c7ec30b830d47d7c3abcd6 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 21 Mar 2020 16:21:15 +0100 Subject: [PATCH] pwd: Add "--physical" and "--logical" long options These were already mentioned in the completions, and we don't typically add short-only options. Fixes #6787. --- doc_src/cmds/pwd.rst | 6 +++--- src/builtin_pwd.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc_src/cmds/pwd.rst b/doc_src/cmds/pwd.rst index 4a16a7c05..d54516c89 100644 --- a/doc_src/cmds/pwd.rst +++ b/doc_src/cmds/pwd.rst @@ -8,7 +8,7 @@ Synopsis :: - pwd + pwd [(-P | --physical)] [(-L | --logical)] Description @@ -18,6 +18,6 @@ Description The following options are available: -- ``-L``, Output the logical working directory, without resolving symlinks (default behavior). +- ``-L`` or ``--logical`` Output the logical working directory, without resolving symlinks (default behavior). -- ``-P``, Output the physical working directory, with symlinks resolved. +- ``-P`` or ``--physical`` Output the physical working directory, with symlinks resolved. diff --git a/src/builtin_pwd.cpp b/src/builtin_pwd.cpp index e81e9f512..6216230f5 100644 --- a/src/builtin_pwd.cpp +++ b/src/builtin_pwd.cpp @@ -16,6 +16,8 @@ /// The pwd builtin. Respect -P to resolve symbolic links. Respect -L to not do that (the default). static const wchar_t *const short_options = L"LPh"; static const struct woption long_options[] = {{L"help", no_argument, nullptr, 'h'}, + {L"logical", no_argument, nullptr, 'L'}, + {L"physical", no_argument, nullptr, 'P'}, {nullptr, 0, nullptr, 0}}; int builtin_pwd(parser_t &parser, io_streams_t &streams, wchar_t **argv) { UNUSED(parser);