From dea13c86a929eb122959eea0d3bac5f8cb4f7dfb Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 16 Mar 2024 16:39:09 +0100 Subject: [PATCH] Document the ! (not) and . (source) aliases more --- doc_src/cmds/not.rst | 3 +++ doc_src/cmds/source.rst | 4 +++- doc_src/fish_synopsis.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc_src/cmds/not.rst b/doc_src/cmds/not.rst index ceb22b6b7..f609d708c 100644 --- a/doc_src/cmds/not.rst +++ b/doc_src/cmds/not.rst @@ -9,6 +9,7 @@ Synopsis .. synopsis:: not COMMAND [OPTIONS ...] + ! COMMAND [OPTIONS ...] Description @@ -16,6 +17,8 @@ Description ``not`` negates the exit status of another command. If the exit status is zero, ``not`` returns 1. Otherwise, ``not`` returns 0. +Some other shells only support the ``!`` alias. + The **-h** or **--help** option displays help about using this command. Example diff --git a/doc_src/cmds/source.rst b/doc_src/cmds/source.rst index 8dd1cd49c..d995c6a84 100644 --- a/doc_src/cmds/source.rst +++ b/doc_src/cmds/source.rst @@ -10,6 +10,7 @@ Synopsis source FILE [ARGUMENTS ...] SOMECOMMAND | source + . FILE [ARGUMENTS ...] Description @@ -23,7 +24,8 @@ If no file is specified and stdin is not the terminal, or if the file name ``-`` The exit status of ``source`` is the exit status of the last job to execute. If something goes wrong while opening or reading the file, ``source`` exits with a non-zero status. -**.** (a single period) is an alias for the ``source`` command. The use of **.** is deprecated in favour of ``source``, and **.** will be removed in a future version of fish. +Some other shells only support the **.** alias (a single period). +The use of **.** is deprecated in favour of ``source``, and **.** will be removed in a future version of fish. ``source`` creates a new :ref:`local scope`; ``set --local`` within a sourced block will not affect variables in the enclosing scope. diff --git a/doc_src/fish_synopsis.py b/doc_src/fish_synopsis.py index d0caff7ca..a134965f8 100644 --- a/doc_src/fish_synopsis.py +++ b/doc_src/fish_synopsis.py @@ -53,7 +53,7 @@ lexer_rules = [ # Hack: treat the "[ expr ]" alias of builtin test as command token (not as grammar # metacharacter). This works because we write it without spaces in the grammar (like # "[OPTIONS]"). - (r"\[ | \]", Name.Constant), + (r"\. |! |\[ | \]", Name.Constant), # Statement separators. (r"\n", Text.Whitespace), (r";", Punctuation),