docs: Use command labels

[ci skip]
This commit is contained in:
Fabian Homborg 2019-03-31 11:07:59 +02:00
parent cf9b8fa3fa
commit cb94dd4d30
11 changed files with 20 additions and 20 deletions

View file

@ -14,7 +14,7 @@ alias [OPTIONS] NAME=DEFINITION
Description
-----------
``alias`` is a simple wrapper for the ``function`` builtin, which creates a function wrapping a command. It has similar syntax to POSIX shell ``alias``. For other uses, it is recommended to define a `function <cmds/function.html>`__.
``alias`` is a simple wrapper for the ``function`` builtin, which creates a function wrapping a command. It has similar syntax to POSIX shell ``alias``. For other uses, it is recommended to define a :ref:`function <cmd-function>`.
``fish`` marks functions that have been created by ``alias`` by including the command used to create them in the function description. You can list ``alias``-created functions by running ``alias`` without arguments. They must be erased using ``functions -e``.
@ -27,7 +27,7 @@ The following options are available:
- ``-h`` or ``--help`` displays help about using this command.
- ``-s`` or ``--save`` Automatically save the function created by the alias into your fish configuration directory using `funcsave <cmds/funcsave.html>`__.
- ``-s`` or ``--save`` Automatically save the function created by the alias into your fish configuration directory using :ref:`funcsave <cmd-funcsave>`.
Example
-------

View file

@ -14,7 +14,7 @@ Description
``and`` is used to execute a command if the previous command was successful (returned a status of 0).
``and`` statements may be used as part of the condition in an `while <cmds/while.html>`__ or `if <cmds/if.html>`__ block.
``and`` statements may be used as part of the condition in an :ref:`while <cmd-while>` or :ref:`if <cmd-if>` block.
``and`` does not change the current exit status itself, but the command it runs most likely will. The exit status of the last foreground command to exit can always be accessed using the `$status <index.html#variables-status>`__ variable.

View file

@ -14,7 +14,7 @@ Description
This command makes it easy for fish scripts and functions to handle arguments in a manner 100% identical to how fish builtin commands handle their arguments. You pass a sequence of arguments that define the options recognized, followed by a literal ``--``, then the arguments to be parsed (which might also include a literal ``--``). More on this in the `usage <#argparse-usage>`__ section below.
Each OPTION_SPEC can be written in the `domain specific language <#argparse-option-specs>`__ described below or created using the companion `fish_opt <cmds/fish-opt.html>`__ command. All OPTION_SPECs must appear after any argparse flags and before the ``--`` that separates them from the arguments to be parsed.
Each OPTION_SPEC can be written in the `domain specific language <#argparse-option-specs>`__ described below or created using the companion :ref:`fish_opt <cmd-fish_opt>` command. All OPTION_SPECs must appear after any argparse flags and before the ``--`` that separates them from the arguments to be parsed.
Each option that is seen in the ARG list will result in a var name of the form ``_flag_X``, where ``X`` is the short flag letter and the long flag name. The OPTION_SPEC always requires a short flag even if it can't be used. So there will always be ``_flag_X`` var set using the short flag letter if the corresponding short or long flag is seen. The long flag name var (e.g., ``_flag_help``) will only be defined, obviously, if the OPTION_SPEC includes a long flag name.
@ -95,7 +95,7 @@ Each option specification is a string composed of
- Optionally a ``!`` followed by fish script to validate the value. Typically this will be a function to run. If the return status is zero the value for the flag is valid. If non-zero the value is invalid. Any error messages should be written to stdout (not stderr). See the section on `Flag Value Validation <#arparse-validation>`__ for more information.
See the `fish_opt <cmds/fish-opt.html>`__ command for a friendlier but more verbose way to create option specifications.
See the :ref:`fish_opt <cmd-fish_opt>` command for a friendlier but more verbose way to create option specifications.
In the following examples if a flag is not seen when parsing the arguments then the corresponding _flag_X var(s) will not be set.

View file

@ -12,7 +12,7 @@ block [OPTIONS...]
Description
-----------
``block`` prevents events triggered by ``fish`` or the `emit <cmds/emit.html>`__ command from being delivered and acted upon while the block is in place.
``block`` prevents events triggered by ``fish`` or the :ref:`emit <cmd-emit>` command from being delivered and acted upon while the block is in place.
In functions, ``block`` can be useful while performing work that should not be interrupted by the shell.

View file

@ -12,7 +12,7 @@ LOOP_CONSTRUCT; [COMMANDS...] break; [COMMANDS...] end
Description
-----------
``break`` halts a currently running loop, such as a `switch <cmds/switch.html>`__, `for <cmds/for.html>`__ or `while <cmds/while.html>`__ loop. It is usually added inside of a conditional block such as an `if <cmds/if.html>`__ block.
``break`` halts a currently running loop, such as a :ref:`switch <cmd-switch>`, :ref:`for <cmd-for>` or :ref:`while <cmd-while>` loop. It is usually added inside of a conditional block such as an :ref:`if <cmd-if>` block.
There are no parameters for ``break``.

View file

@ -19,7 +19,7 @@ If ``DIRECTORY`` is a relative path, the paths found in the ``CDPATH`` list will
Note that the shell will attempt to change directory without requiring ``cd`` if the name of a directory is provided (starting with ``.``, ``/`` or ``~``, or ending with ``/``).
Fish also ships a wrapper function around the builtin ``cd`` that understands ``cd -`` as changing to the previous directory. See also `prevd <cmds/prevd.html>`__. This wrapper function maintains a history of the 25 most recently visited directories in the ``$dirprev`` and ``$dirnext`` global variables. If you make those universal variables your ``cd`` history is shared among all fish instances.
Fish also ships a wrapper function around the builtin ``cd`` that understands ``cd -`` as changing to the previous directory. See also :ref:`prevd <cmd-prevd>`. This wrapper function maintains a history of the 25 most recently visited directories in the ``$dirprev`` and ``$dirnext`` global variables. If you make those universal variables your ``cd`` history is shared among all fish instances.
As a special case, ``cd .`` is equivalent to ``cd $PWD``, which is useful in cases where a mountpoint has been recycled or a directory has been removed and recreated.
@ -40,4 +40,4 @@ Examples
See Also
--------
See also the `cdh <cmds/cdh.html>`__ command for changing to a recently visited directory.
See also the :ref:`cdh <cmd-cdh>` command for changing to a recently visited directory.

View file

@ -14,4 +14,4 @@ Description
``exit`` causes fish to exit. If ``STATUS`` is supplied, it will be converted to an integer and used as the exit code. Otherwise, the exit code will be that of the last command executed.
If exit is called while sourcing a file (using the `source <cmds/source.html>`__ builtin) the rest of the file will be skipped, but the shell itself will not exit.
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.

View file

@ -15,7 +15,7 @@ Synopsis
Description
-----------
This command provides a way to produce option specifications suitable for use with the `argparse <cmds/argparse.html>`__ command. You can, of course, write the option specs by hand without using this command. But you might prefer to use this for the clarity it provides.
This command provides a way to produce option specifications suitable for use with the :ref:`argparse <cmd-argparse>` command. You can, of course, write the option specs by hand without using this command. But you might prefer to use this for the clarity it provides.
The following ``argparse`` options are available:

View file

@ -22,7 +22,7 @@ The following options are available:
- ``-d DESCRIPTION`` or ``--description=DESCRIPTION`` is a description of what the function does, suitable as a completion description.
- ``-w WRAPPED_COMMAND`` or ``--wraps=WRAPPED_COMMAND`` causes the function to inherit completions from the given wrapped command. See the documentation for `complete <cmds/complete.html>`__ for more information.
- ``-w WRAPPED_COMMAND`` or ``--wraps=WRAPPED_COMMAND`` causes the function to inherit completions from the given wrapped command. See the documentation for :ref:`complete <cmd-complete>` for more information.
- ``-e`` or ``--on-event EVENT_NAME`` tells fish to run this function when the specified named event is emitted. Fish internally generates named events e.g. when showing the prompt.
@ -43,7 +43,7 @@ The following options are available:
If the user enters any additional arguments after the function, they are inserted into the environment `variable array <index.html#variables-arrays>`__ ``$argv``. If the ``--argument-names`` option is provided, the arguments are also assigned to names specified in that option.
By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the `emit <cmds/emit.html>`__ builtin. Fish generates the following named events:
By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the :ref:`emit <cmd-emit>` builtin. Fish generates the following named events:
- ``fish_prompt``, which is emitted whenever a new fish prompt is about to be displayed.

View file

@ -3,7 +3,7 @@ Frequently asked questions
How do I set or clear an environment variable?
----------------------------------------------
Use the `set <cmds/set.html>`__ command::
Use the :ref:`set <cmd-set>` command::
set -x key value
set -e key
@ -26,7 +26,7 @@ The prompt is the output of the ``fish_prompt`` function. Put it in ``~/.config/
end
You can also use the Web configuration tool, `fish_config <cmds/fish_config.html>`__, to preview and choose from a gallery of sample prompts.
You can also use the Web configuration tool, :ref:`fish_config <cmd-fish_config>`, to preview and choose from a gallery of sample prompts.
How do I run a command from history?
@ -93,7 +93,7 @@ If you are just interested in success or failure, you can run the command direct
end
See the documentation for `test <cmds/test.html>`__ and `if <cmds/if.html>`__ for more information.
See the documentation for :ref:`test <cmd-test>` and :ref:`if <cmd-if>` for more information.
~~
How do I set an environment variable for just one command?
@ -162,12 +162,12 @@ add a statement to your `user initialization file <index#initialization-files>`_
How do I customize my syntax highlighting colors?
-------------------------------------------------
Use the web configuration tool, `fish_config <cmds/fish_config.html>`__, or alter the `fish_color family of environment variables <index#variables-color>`__.
Use the web configuration tool, :ref:`fish_config <cmd-fish_config>`, or alter the `fish_color family of environment variables <index#variables-color>`__.
~~
How do I update man page completions?
-------------------------------------
Use the `fish_update_completions <cmds/fish_update_completions.html>`__ command.
Use the :ref:`fish_update_completions <cmd-fish_update_completions>` command.
~~
I accidentally entered a directory path and fish changed directory. What happened?

View file

@ -445,7 +445,7 @@ Use ``if``, ``else if``, and ``else`` to conditionally execute code, based on th
end
To compare strings or numbers or check file properties (whether a file exists or is writeable and such), use `test <cmds/test.html>`__, like
To compare strings or numbers or check file properties (whether a file exists or is writeable and such), use :ref:`test <cmd-test>`, like
@ -650,7 +650,7 @@ This is the preferred way to define your prompt as well::
end
See the documentation for `funced <cmds/funced.html>`__ and `funcsave <cmds/funcsave.html>`__ for ways to create these files automatically.
See the documentation for :ref:`funced <cmd-funced>` and :ref:`funcsave <cmd-funcsave>` for ways to create these files automatically.
Universal Variables
-------------------