mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
doc_src: Continue the slog through the letter F.
We are using only :: in a synopsis for fishscript examples given of the command being documented.
This commit is contained in:
parent
5e880bb1c3
commit
af61ea1325
36 changed files with 114 additions and 118 deletions
|
@ -6,7 +6,7 @@ begin - start a new block of code
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``begin``; [*COMMANDS* ...]; ``end``
|
||||
**begin**; [*COMMANDS* ...]; **end**
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,8 +6,7 @@ block - temporarily block delivery of events
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``block`` [*OPTIONS* ...]
|
||||
|
||||
**block** [*OPTIONS* ...]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,8 +6,8 @@ builtin - run a builtin command
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
| ``builtin`` [*OPTIONS* ...] *BUILTINNAME*
|
||||
| ``builtin`` --query *BUILTINNAMES* ...
|
||||
| **builtin** [*OPTIONS* ...] *BUILTINNAME*
|
||||
| **builtin** --query *BUILTINNAMES* ...
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,10 +6,10 @@ case - conditionally execute a block of commands
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
| ``switch`` *VALUE*
|
||||
| [``case`` [*GLOB*...]
|
||||
| **switch** *VALUE*
|
||||
| [**case** [*GLOB*...]
|
||||
| [*COMMAND* ...]]
|
||||
| ``end``
|
||||
| **end**
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,7 +6,7 @@ cdh - change to a recently visited directory
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``cdh`` [ *DIR* ]
|
||||
``cdh`` [*DIR*]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,7 +6,7 @@ commandline - set or get the current command line buffer
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``commandline`` [**OPTIONS**] [**CMD**]
|
||||
``commandline`` [*OPTIONS*] [*CMD*]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,25 +6,26 @@ contains - test if a word is present in a list
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``contains`` [**options**] *KEY* [*VALUE* ...]
|
||||
``contains`` [**options**] *KEY* [*VALUES* ...]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``contains`` tests whether the set ``VALUES`` contains the string ``KEY``. If so, ``contains`` exits with status 0; if not, it exits with status 1.
|
||||
``contains`` tests whether the set *VALUES* contains the string *KEY*.
|
||||
If so, ``contains`` exits with code 0; if not, it exits with code 1.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- ``-i`` or ``--index`` print the word index
|
||||
- **-i** or **--index** print the word index
|
||||
|
||||
Note that, like GNU tools and most of fish's builtins, ``contains`` interprets all arguments starting with a ``-`` as options to contains, until it reaches an argument that is ``--`` (two dashes). See the examples below.
|
||||
Note that ``contains`` interprets all arguments starting with a **-** as an option to ``contains``, until an **--** argument is reached.
|
||||
|
||||
See the examples below.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
If $animals is a list of animals, the following will test if it contains a cat:
|
||||
|
||||
|
||||
If *animals* is a list of animals, the following will test if *animals* contains "cat":
|
||||
|
||||
::
|
||||
|
||||
|
@ -33,9 +34,7 @@ If $animals is a list of animals, the following will test if it contains a cat:
|
|||
end
|
||||
|
||||
|
||||
This code will add some directories to $PATH if they aren't yet included:
|
||||
|
||||
|
||||
This code will add some directories to :envvar:`PATH` if they aren't yet included:
|
||||
|
||||
::
|
||||
|
||||
|
@ -46,9 +45,7 @@ This code will add some directories to $PATH if they aren't yet included:
|
|||
end
|
||||
|
||||
|
||||
While this will check if ``hasargs`` was run with the ``-q`` option:
|
||||
|
||||
|
||||
While this will check if function ``hasargs`` is being ran with the **-q** option:
|
||||
|
||||
::
|
||||
|
||||
|
@ -59,4 +56,5 @@ While this will check if ``hasargs`` was run with the ``-q`` option:
|
|||
end
|
||||
|
||||
|
||||
The ``--`` here stops ``contains`` from treating ``-q`` to an option to itself. Instead it treats it as a normal string to check.
|
||||
The **--** here stops ``contains`` from treating **-q** to an option to itself.
|
||||
Instead it treats it as a normal string to check.
|
||||
|
|
|
@ -6,7 +6,7 @@ continue - skip the remainder of the current iteration of the current inner loop
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
**LOOP_CONSTRUCT**; [**COMMANDS**...;] ``continue``; [**COMMANDS**...;] **end**
|
||||
**LOOP_CONSTRUCT**; [*COMMANDS*...;] **continue**; [*COMMANDS*...;] **end**
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,7 +6,7 @@ disown - remove a process from the list of jobs
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
disown [ **PID** ... ]
|
||||
``disown`` [ **PID** ... ]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,14 +6,14 @@ else - execute command if a condition is not met
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
**if** *CONDITION*; *COMMANDS_TRUE*...; [``else``; *COMMANDS_FALSE*...;] **end**
|
||||
**if** *CONDITION*; *COMMANDS_TRUE*...; [**else**; *COMMANDS_FALSE*...;] **end**
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
:ref:`if <cmd-if>` will execute the command **CONDITION**.
|
||||
:ref:`if <cmd-if>` will execute the command *CONDITION**.
|
||||
If the condition's exit status is 0, the commands *COMMANDS_TRUE* will execute.
|
||||
If it is not 0 and ``else`` is given, *COMMANDS_FALSE* will be executed.
|
||||
If it is not 0 and **else** is given, *COMMANDS_FALSE* will be executed.
|
||||
|
||||
|
||||
Example
|
||||
|
|
|
@ -8,7 +8,6 @@ Synopsis
|
|||
|
||||
**eval** [*COMMANDS*...]
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
**eval** evaluates the specified parameters as a command.
|
||||
|
|
|
@ -12,7 +12,7 @@ Synopsis
|
|||
Description
|
||||
-----------
|
||||
|
||||
``exit`` is a special builtin that causes the shell to exit. Either 255 or the *code* supplied is used, whichever is lesser.
|
||||
**exit** is a special builtin that causes the shell to exit. Either 255 or the *code* supplied is used, whichever is lesser.
|
||||
Otherwise, the exit status will be that of the last command executed.
|
||||
|
||||
If exit is called while sourcing a file (using the :ref:`source <cmd-source>` builtin) the rest of the file will be skipped, but the shell itself will not exit.
|
||||
|
|
|
@ -6,7 +6,7 @@ fg - bring job to foreground
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
**fg** [*PID*]
|
||||
``fg`` [*PID*]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
@ -16,7 +16,7 @@ While a foreground job is executed, fish is suspended.
|
|||
If no job is specified, the last job to be used is put in the foreground.
|
||||
If ``PID`` is specified, the job containing a process with the specified process ID is put in the foreground.
|
||||
|
||||
For compatibility with other shells, job expansion syntax is supported for ``fg``. A ``PID`` of the format ``%1`` will foreground job 1.
|
||||
For compatibility with other shells, job expansion syntax is supported for ``fg``. A *PID* of the format **%1** will foreground job 1.
|
||||
Job numbers can be seen in the output of :ref:`jobs <cmd-jobs>`.
|
||||
|
||||
Example
|
||||
|
|
|
@ -7,8 +7,8 @@ fish - the friendly interactive shell
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
**fish** [*OPTIONS*] [*FILE* [*ARGS* ...]]
|
||||
**fish** [*OPTIONS*] [**-c** *COMMAND* [*ARGS* ...]]
|
||||
| ``fish`` [*OPTIONS*] [*FILE* [ARGS ...]]
|
||||
| ``fish`` [*OPTIONS*] [**-c** *COMMAND* [ARGS ...]]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
@ -21,39 +21,55 @@ The :ref:`tutorial <tutorial>` is available as HTML via ``help tutorial`` or in
|
|||
|
||||
The following options are available:
|
||||
|
||||
- ``-c`` or ``--command=COMMANDS`` evaluate the specified commands instead of reading from the commandline, passing any additional positional arguments via ``$argv``.
|
||||
Note that, unlike other shells, the first argument is *not* the name of the program ``$0``, but simply the first normal argument.
|
||||
**-c** or **--command=COMMAND**
|
||||
Evaluate the specified commands instead of reading from the commandline, passing additional positional arguments through ``$argv``.
|
||||
|
||||
- ``-C`` or ``--init-command=COMMANDS`` evaluate the specified commands after reading the configuration, before running the command specified by ``-c`` or reading interactive input.
|
||||
**-C** or **--init-command=COMMANDS**
|
||||
Evaluate specified commands after reading the configuration but before executing command specified by **-c** or reading interactive input.
|
||||
|
||||
- ``-d`` or ``--debug=DEBUG_CATEGORIES`` enable debug output and specify a pattern for matching debug categories. See :ref:`Debugging <debugging-fish>` below for details.
|
||||
**-d** or **--debug=DEBUG_CATEGORIES**
|
||||
Enables debug output and specify a pattern for matching debug categories.
|
||||
See :ref:`Debugging <debugging-fish>` below for details.
|
||||
|
||||
- ``-o`` or ``--debug-output=DEBUG_FILE`` specify a file path to receive the debug output, including categories and :envvar:`fish_trace`. The default is stderr.
|
||||
**-o** or **--debug-output=DEBUG_FILE**
|
||||
Specifies a file path to receive the debug output, including categories and :envvar:`fish_trace`.
|
||||
The default is stderr.
|
||||
|
||||
- ``-i`` or ``--interactive`` specify that fish is to run in interactive mode
|
||||
**-i** or **--interactive**
|
||||
The shell is interactive.
|
||||
|
||||
- ``-l`` or ``--login`` specify that fish is to run as a login shell
|
||||
**-l** or **--login**
|
||||
Act as if invoked as a login shell.
|
||||
|
||||
- ``-N`` or ``--no-config`` do not read configuration files
|
||||
**-N** or **--no-config**
|
||||
Do not read configuration files.
|
||||
|
||||
- ``-n`` or ``--no-execute`` do not execute any commands, only perform syntax checking
|
||||
**-n** or **--no-execute**
|
||||
Do not execute any commands, only perform syntax checking.
|
||||
|
||||
- ``-p`` or ``--profile=PROFILE_FILE`` when :command:`fish` exits, output timing information on all executed commands to the specified file. This excludes time spent starting up and reading the configuration.
|
||||
**-p** or **--profile=PROFILE_FILE**
|
||||
when :command:`fish` exits, output timing information on all executed commands to the specified file.
|
||||
This excludes time spent starting up and reading the configuration.
|
||||
|
||||
- ``--profile-startup=PROFILE_FILE`` will write timing information for fish's startup to the specified file. This is useful to profile your configuration.
|
||||
**--profile-startup=PROFILE_FILE**
|
||||
Will write timing for ``fish`` startup to specified file.
|
||||
|
||||
- ``-P`` or ``--private`` enables :ref:`private mode <private-mode>`, so fish will not access old or store new history.
|
||||
**-P** or **--private**
|
||||
Enables :ref:`private mode <private-mode>`: **fish** will not access old or store new history.
|
||||
|
||||
- ``--print-rusage-self`` when :command:`fish` exits, output stats from getrusage.
|
||||
**--print-rusage-self**
|
||||
When :command:`fish` exits, output stats from getrusage.
|
||||
|
||||
- ``--print-debug-categories`` outputs the list of debug categories, and then exits.
|
||||
**--print-debug-categories**
|
||||
Print all debug categories, and then exit.
|
||||
|
||||
- ``-v`` or ``--version`` display version and exit.
|
||||
**-v** or **--version**
|
||||
Print version and exit.
|
||||
|
||||
- ``-f`` or ``--features=FEATURES`` enables one or more :ref:`feature flags <featureflags>` (separated by a comma).
|
||||
These are how fish stages changes that might break scripts.
|
||||
**-f** or **--features=FEATURES**
|
||||
Enables one or more comma-separated :ref:`feature flags <featureflags>`.
|
||||
|
||||
The fish exit status is generally the :ref:`exit status of the last foreground command <variables-status>`.
|
||||
The ``fish`` exit status is generally the :ref:`exit status of the last foreground command <variables-status>`.
|
||||
|
||||
.. _debugging-fish:
|
||||
|
||||
|
@ -61,24 +77,24 @@ Debugging
|
|||
---------
|
||||
|
||||
While fish provides extensive support for :ref:`debugging fish scripts <debugging>`, it is also possible to debug and instrument its internals.
|
||||
Debugging can be enabled by passing the ``--debug`` option.
|
||||
Debugging can be enabled by passing the **--debug** option.
|
||||
For example, the following command turns on debugging for background IO thread events, in addition to the default categories, i.e. *debug*, *error*, *warning*, and *warning-path*:
|
||||
::
|
||||
|
||||
> fish --debug=iothread
|
||||
|
||||
Available categories are listed by ``fish --print-debug-categories``. The ``--debug`` option accepts a comma-separated list of categories, and supports glob syntax.
|
||||
Available categories are listed by ``fish --print-debug-categories``. The **--debug** option accepts a comma-separated list of categories, and supports glob syntax.
|
||||
The following command turns on debugging for *complete*, *history*, *history-file*, and *profile-history*, as well as the default categories:
|
||||
::
|
||||
|
||||
> fish --debug='complete,*history*'
|
||||
|
||||
Debug messages output to stderr by default. Note that if ``fish_trace`` is set, execution tracing also outputs to stderr by default. You can output to a file using the ``--debug-output`` option:
|
||||
Debug messages output to stderr by default. Note that if :envvar:`fish_trace` is set, execution tracing also outputs to stderr by default. You can output to a file using the **--debug-output** option:
|
||||
::
|
||||
|
||||
> fish --debug='complete,*history*' --debug-output=/tmp/fish.log --init-command='set fish_trace on'
|
||||
|
||||
These options can also be changed via the :envvar:`FISH_DEBUG` and :envvar:`FISH_DEBUG_OUTPUT` variables.
|
||||
The categories enabled via ``--debug`` are *added* to the ones enabled by $FISH_DEBUG, so they can be disabled by prefixing them with ``-`` (``reader-*,-ast*`` enables reader debugging and disables ast debugging).
|
||||
The categories enabled via **--debug** are *added* to the ones enabled by $FISH_DEBUG, so they can be disabled by prefixing them with **-** (**reader-*,-ast*** enables reader debugging and disables ast debugging).
|
||||
|
||||
The file given in ``--debug-output`` takes precedence over the file in :envvar:`FISH_DEBUG_OUTPUT`.
|
||||
The file given in **--debug-output** takes precedence over the file in :envvar:`FISH_DEBUG_OUTPUT`.
|
||||
|
|
|
@ -7,9 +7,8 @@ fish_add_path - add to the path
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``fish_add_path`` *path*...
|
||||
|
||||
``fish_add_path`` [(*-g* | *--global*) | (*-U* | *--universal*) | (*-P* | *--path*)] [(*-m* | *--move*)] [(*-a* | *--append*) | (*-p* | *--prepend*)] [(*-v* | *--verbose*) | (*-n* | *--dry-run*)] *paths*...
|
||||
| ``fish_add_path`` *path*...
|
||||
| ``fish_add_path`` [(*-g* | *--global*) | (*-U* | *--universal*) | (*-P* | *--path*)] [(*-m* | *--move*)] [(*-a* | *--append*) | (*-p* | *--prepend*)] [(*-v* | *--verbose*) | (*-n* | *--dry-run*)] *paths*...
|
||||
|
||||
|
||||
Description
|
||||
|
|
|
@ -6,9 +6,12 @@ fish_breakpoint_prompt - define the prompt when stopped at a breakpoint
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
| **function** *fish_breakpoint_prompt*
|
||||
| ...
|
||||
| end
|
||||
**fish_breakpoint_prompt**
|
||||
::
|
||||
|
||||
function fish_breakpoint_prompt
|
||||
...
|
||||
end
|
||||
|
||||
|
||||
Description
|
||||
|
|
|
@ -6,11 +6,9 @@ fish_command_not_found - what to do when a command wasn't found
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
function fish_command_not_found
|
||||
...
|
||||
end
|
||||
| **function** ``fish_command_not_found``
|
||||
| ...
|
||||
| **end**
|
||||
|
||||
|
||||
Description
|
||||
|
|
|
@ -6,11 +6,9 @@ fish_config - start the web-based configuration interface
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
fish_config [browse]
|
||||
fish_config prompt (choose | list | save | show)
|
||||
fish_config theme (choose | demo | dump | list | save | show)
|
||||
| ``fish_config`` [browse]
|
||||
| ``fish_config`` **prompt** (choose | list | save | show)
|
||||
| ``fish_config`` **theme** (choose | demo | dump | list | save | show)
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,12 +6,14 @@ fish_git_prompt - output git information for use in a prompt
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``fish_git_prompt``
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
printf '%s' $PWD (fish_git_prompt) ' $ '
|
||||
end
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_greeting - display a welcome message in interactive shells
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
**fish_greeting**
|
||||
::
|
||||
|
||||
function fish_greeting
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_hg_prompt - output Mercurial information for use in a prompt
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
**fish_hg_prompt**
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
|
|
|
@ -6,9 +6,7 @@ fish_is_root_user - check if the current user is root
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
fish_is_root_user
|
||||
**fish_is_root_user**
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,9 +6,7 @@ fish_key_reader - explore what characters keyboard keys send
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
fish_key_reader [OPTIONS]
|
||||
**fish_key_reader** [*OPTIONS*]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_mode_prompt - define the appearance of the mode indicator
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
**fish_mode_prompt**
|
||||
::
|
||||
|
||||
function fish_mode_prompt
|
||||
|
|
|
@ -5,12 +5,8 @@ fish_opt - create an option spec for the argparse command
|
|||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
fish_opt [ -h | --help ]
|
||||
fish_opt ( -s X | --short=X ) [ -l LONG | --long=LONG ] [ --long-only ] [ -o | --optional-val ] [ -r | --required-val ] [ --multiple-vals ]
|
||||
|
||||
| ``fish_opt`` [ **--help** ]
|
||||
| ``fish_opt`` [ (**-slor**, **--multiple-vals=**) *optname*]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_prompt - define the appearance of the command line prompt
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``fish_prompt``
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_status_to_signal - convert exit codes to human-friendly signals
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``fish_status_to_signal`` *NUM*
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
|
@ -26,4 +27,4 @@ Example
|
|||
>_ sleep 5
|
||||
^C⏎
|
||||
>_ fish_status_to_signal $status
|
||||
SIGINT
|
||||
SIGINT
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_svn_prompt - output Subversion information for use in a prompt
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``fish_svn_prompt``
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_title - define the terminal's title
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``fish_title``
|
||||
::
|
||||
|
||||
function fish_title
|
||||
|
|
|
@ -6,9 +6,7 @@ fish_update_completions - update completions using manual pages
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
fish_update_completions
|
||||
``fish_update_completions``
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
@ -6,6 +6,7 @@ fish_vcs_prompt - output version control system information for use in a prompt
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
``fish_vcs_prompt``
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
|
|
|
@ -6,22 +6,18 @@ for - perform a set of commands multiple times
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
for VARNAME in [VALUES...]; COMMANDS...; end
|
||||
**for** *VARNAME* in [*VALUES*...]; *COMMANDS*...; **end**
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``for`` is a loop construct. It will perform the commands specified by ``COMMANDS`` multiple times. On each iteration, the local variable specified by ``VARNAME`` is assigned a new value from ``VALUES``. If ``VALUES`` is empty, ``COMMANDS`` will not be executed at all. The ``VARNAME`` is visible when the loop terminates and will contain the last value assigned to it. If ``VARNAME`` does not already exist it will be set in the local scope. For our purposes if the ``for`` block is inside a function there must be a local variable with the same name. If the ``for`` block is not nested inside a function then global and universal variables of the same name will be used if they exist.
|
||||
**for** is a loop construct. It will perform the commands specified by *COMMANDS* multiple times. On each iteration, the local variable specified by *VARNAME* is assigned a new value from *VALUES*. If *VALUES* is empty, *COMMANDS* will not be executed at all. The *VARNAME* is visible when the loop terminates and will contain the last value assigned to it. If *VARNAME* does not already exist it will be set in the local scope. For our purposes if the **for** block is inside a function there must be a local variable with the same name. If the **for** block is not nested inside a function then global and universal variables of the same name will be used if they exist.
|
||||
|
||||
Much like :ref:`set <cmd-set>`, ``for`` does not modify $status, but the evaluation of its subordinate commands can.
|
||||
Much like :ref:`set <cmd-set>`, **for** does not modify $status, but the evaluation of its subordinate commands can.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
for i in foo bar baz; echo $i; end
|
||||
|
@ -37,8 +33,6 @@ Notes
|
|||
|
||||
The ``VARNAME`` was local to the for block in releases prior to 3.0.0. This means that if you did something like this:
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
for var in a b c
|
||||
|
|
|
@ -6,20 +6,18 @@ funced - edit a function interactively
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
funced [OPTIONS] NAME
|
||||
``funced`` [**OPTIONS**] *NAME*
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``funced`` provides an interface to edit the definition of the function ``NAME``.
|
||||
``funced`` provides an interface to edit the definition of the function *NAME*.
|
||||
|
||||
If the ``$VISUAL`` environment variable is set, it will be used as the program to edit the function. If ``$VISUAL`` is unset but ``$EDITOR`` is set, that will be used. Otherwise, a built-in editor will be used. Note that to enter a literal newline using the built-in editor you should press :kbd:`Alt`\ +\ :kbd:`Enter`. Pressing :kbd:`Enter` signals that you are done editing the function. This does not apply to an external editor like emacs or vim.
|
||||
|
||||
``funced`` will try to edit the original file that a function is defined in, which might include variable definitions or helper functions as well. If changes cannot be saved to the original file, a copy will be created in the user's function directory.
|
||||
|
||||
If there is no function called ``NAME``, a new function will be created with the specified name.
|
||||
If there is no function called *NAME*, a new function will be created with the specified name.
|
||||
|
||||
- ``-e command`` or ``--editor command`` Open the function body inside the text editor given by the command (for example, ``-e vi``). The special command ``fish`` will use the built-in editor (same as specifying ``-i``).
|
||||
|
||||
|
|
|
@ -6,10 +6,8 @@ funcsave - save the definition of a function to the user's autoload directory
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
funcsave FUNCTION_NAME
|
||||
funcsave [-q] [(-d | --directory) DIR ] FUNCTION_NAME
|
||||
| ``funcsave`` *FUNCTION_NAME*
|
||||
| ``funcsave`` [**-q**] [(**-d** | **--directory**) *DIR*] *FUNCTION_NAME*
|
||||
|
||||
|
||||
Description
|
||||
|
|
|
@ -6,9 +6,7 @@ function - create a function
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
function NAME [OPTIONS]; BODY; end
|
||||
**function** *NAME* [*OPTIONS*]; BODY ...; **end**
|
||||
|
||||
|
||||
Description
|
||||
|
|
|
@ -6,13 +6,11 @@ functions - print or erase functions
|
|||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
functions [ -a | --all ] [ -n | --names ]
|
||||
functions [ -D | --details ] [ -v ] FUNCTION
|
||||
functions -c OLDNAME NEWNAME
|
||||
functions -d DESCRIPTION FUNCTION
|
||||
functions [ -e | -q ] FUNCTIONS...
|
||||
| **functions** [ **-a** | **--all** ] [ **-n | **--names** ]
|
||||
| **functions** [ **-D** | **--details** ] [ **-v** ] *FUNCTION*
|
||||
| **functions** **-c** *OLDNAME* *NEWNAME*
|
||||
| **functions** **-d** *DESCRIPTION* *FUNCTION*
|
||||
| **functions** [ **-e** | **-q** ] *FUNCTIONS...*
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
Loading…
Reference in a new issue