mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Document the ! (not) and . (source) aliases more
This commit is contained in:
parent
e97a4fab71
commit
dea13c86a9
3 changed files with 7 additions and 2 deletions
|
@ -9,6 +9,7 @@ Synopsis
|
||||||
.. synopsis::
|
.. synopsis::
|
||||||
|
|
||||||
not COMMAND [OPTIONS ...]
|
not COMMAND [OPTIONS ...]
|
||||||
|
! COMMAND [OPTIONS ...]
|
||||||
|
|
||||||
|
|
||||||
Description
|
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.
|
``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.
|
The **-h** or **--help** option displays help about using this command.
|
||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
|
@ -10,6 +10,7 @@ Synopsis
|
||||||
|
|
||||||
source FILE [ARGUMENTS ...]
|
source FILE [ARGUMENTS ...]
|
||||||
SOMECOMMAND | source
|
SOMECOMMAND | source
|
||||||
|
. FILE [ARGUMENTS ...]
|
||||||
|
|
||||||
|
|
||||||
Description
|
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.
|
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<variables-scope>`; ``set --local`` within a sourced block will not affect variables in the enclosing scope.
|
``source`` creates a new :ref:`local scope<variables-scope>`; ``set --local`` within a sourced block will not affect variables in the enclosing scope.
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ lexer_rules = [
|
||||||
# Hack: treat the "[ expr ]" alias of builtin test as command token (not as grammar
|
# 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
|
# metacharacter). This works because we write it without spaces in the grammar (like
|
||||||
# "[OPTIONS]").
|
# "[OPTIONS]").
|
||||||
(r"\[ | \]", Name.Constant),
|
(r"\. |! |\[ | \]", Name.Constant),
|
||||||
# Statement separators.
|
# Statement separators.
|
||||||
(r"\n", Text.Whitespace),
|
(r"\n", Text.Whitespace),
|
||||||
(r";", Punctuation),
|
(r";", Punctuation),
|
||||||
|
|
Loading…
Reference in a new issue