From 86d457422282f0490d530b9080ce8bf17d622fdf Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sun, 31 Mar 2019 11:24:04 +0200 Subject: [PATCH] docs: Use more command labels --- sphinx_doc_src/cmds/bind.rst | 2 +- sphinx_doc_src/cmds/continue.rst | 2 +- sphinx_doc_src/cmds/dirs.rst | 2 +- sphinx_doc_src/cmds/if.rst | 2 +- sphinx_doc_src/cmds/or.rst | 4 ++-- sphinx_doc_src/cmds/popd.rst | 2 +- sphinx_doc_src/cmds/pushd.rst | 2 +- sphinx_doc_src/cmds/return.rst | 2 +- sphinx_doc_src/cmds/while.rst | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sphinx_doc_src/cmds/bind.rst b/sphinx_doc_src/cmds/bind.rst index e6a7b0656..8347040c6 100644 --- a/sphinx_doc_src/cmds/bind.rst +++ b/sphinx_doc_src/cmds/bind.rst @@ -26,7 +26,7 @@ Description SEQUENCE is the character sequence to bind to. These should be written as `fish escape sequences `__. For example, because pressing the Alt key and another character sends that character prefixed with an escape character, Alt-based key bindings can be written using the ``\e`` escape. For example, :kbd:`Alt+w` can be written as ``\ew``. The control character can be written in much the same way using the ``\c`` escape, for example :kbd:`Control+X` (^X) can be written as ``\cx``. Note that Alt-based key bindings are case sensitive and Control-based key bindings are not. This is a constraint of text-based terminals, not ``fish``. -The default key binding can be set by specifying a ``SEQUENCE`` of the empty string (that is, ``''`` ). It will be used whenever no other binding matches. For most key bindings, it makes sense to use the ``self-insert`` function (i.e. ``````bind '' self-insert``````) as the default keybinding. This will insert any keystrokes not specifically bound to into the editor. Non- printable characters are ignored by the editor, so this will not result in control sequences being printable. +The default key binding can be set by specifying a ``SEQUENCE`` of the empty string (that is, ``''`` ). It will be used whenever no other binding matches. For most key bindings, it makes sense to use the ``self-insert`` function (i.e. ``bind '' self-insert``) as the default keybinding. This will insert any keystrokes not specifically bound to into the editor. Non- printable characters are ignored by the editor, so this will not result in control sequences being printable. If the ``-k`` switch is used, the name of the key (such as 'down', 'up' or 'backspace') is used instead of a sequence. The names used are the same as the corresponding curses variables, but without the 'key\_' prefix. (See ``terminfo(5)`` for more information, or use ``bind --key-names`` for a list of all available named keys.) If used in conjunction with the ``-s`` switch, ``bind`` will silently ignore bindings to named keys that are not found in termcap for the current ``$TERMINAL``, otherwise a warning is emitted. diff --git a/sphinx_doc_src/cmds/continue.rst b/sphinx_doc_src/cmds/continue.rst index d31c9e545..bef361bbc 100644 --- a/sphinx_doc_src/cmds/continue.rst +++ b/sphinx_doc_src/cmds/continue.rst @@ -12,7 +12,7 @@ LOOP_CONSTRUCT; [COMMANDS...;] continue; [COMMANDS...;] end Description ----------- -``continue`` skips the remainder of the current iteration of the current inner loop, such as a for loop or a while loop. It is usually added inside of a conditional block such as an if statement or a switch statement. +``continue`` skips the remainder of the current iteration of the current inner loop, such as a :ref:`for ` loop or a :ref:`while ` loop. It is usually added inside of a conditional block such as an :ref:`if ` statement or a :ref:`switch ` statement. Example ------- diff --git a/sphinx_doc_src/cmds/dirs.rst b/sphinx_doc_src/cmds/dirs.rst index f5f9440dc..286f2f679 100644 --- a/sphinx_doc_src/cmds/dirs.rst +++ b/sphinx_doc_src/cmds/dirs.rst @@ -13,7 +13,7 @@ dirs -c Description ----------- -``dirs`` prints the current directory stack, as created by the ``pushd`` command. +``dirs`` prints the current directory stack, as created by the :ref:`pushd ` command. With "-c", it clears the directory stack instead. diff --git a/sphinx_doc_src/cmds/if.rst b/sphinx_doc_src/cmds/if.rst index 7e5c0fa4c..cb44727fd 100644 --- a/sphinx_doc_src/cmds/if.rst +++ b/sphinx_doc_src/cmds/if.rst @@ -17,7 +17,7 @@ Description ``if`` will execute the command ``CONDITION``. If the condition's exit status is 0, the commands ``COMMANDS_TRUE`` will execute. If the exit status is not 0 and ``else`` is given, ``COMMANDS_FALSE`` will be executed. -You can use ``and`` or ``or`` in the condition. See the second example below. +You can use :ref:`and ` or :ref:`or ` in the condition. See the second example below. The exit status of the last foreground command to exit can always be accessed using the $status variable. diff --git a/sphinx_doc_src/cmds/or.rst b/sphinx_doc_src/cmds/or.rst index 9d5436139..f7037dfd0 100644 --- a/sphinx_doc_src/cmds/or.rst +++ b/sphinx_doc_src/cmds/or.rst @@ -14,8 +14,8 @@ Description ``or`` is used to execute a command if the previous command was not successful (returned a status of something other than 0). -``or`` statements may be used as part of the condition in an ``and`` or ``while`` block. See the documentation -for ``if`` and ``while`` for examples. +``or`` statements may be used as part of the condition in an :ref:`and ` or :ref:`while ` block. See the documentation +for :ref:`if ` and :ref:`while ` for examples. ``or`` 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 variable. diff --git a/sphinx_doc_src/cmds/popd.rst b/sphinx_doc_src/cmds/popd.rst index 772dbb690..476ed8718 100644 --- a/sphinx_doc_src/cmds/popd.rst +++ b/sphinx_doc_src/cmds/popd.rst @@ -12,7 +12,7 @@ popd Description ----------- -``popd`` removes the top directory from the directory stack and changes the working directory to the new top directory. Use ``pushd`` to add directories to the stack. +``popd`` removes the top directory from the directory stack and changes the working directory to the new top directory. Use :ref:`pushd ` to add directories to the stack. You may be interested in the ``cdh`` command which provides a more intuitive way to navigate to recently visited directories. diff --git a/sphinx_doc_src/cmds/pushd.rst b/sphinx_doc_src/cmds/pushd.rst index 82cc1a0bc..713bee2e5 100644 --- a/sphinx_doc_src/cmds/pushd.rst +++ b/sphinx_doc_src/cmds/pushd.rst @@ -12,7 +12,7 @@ pushd [DIRECTORY] Description ----------- -The ``pushd`` function adds ``DIRECTORY`` to the top of the directory stack and makes it the current working directory. ``popd`` will pop it off and return to the original directory. +The ``pushd`` function adds ``DIRECTORY`` to the top of the directory stack and makes it the current working directory. :ref:`popd ` will pop it off and return to the original directory. Without arguments, it exchanges the top two directories in the stack. diff --git a/sphinx_doc_src/cmds/return.rst b/sphinx_doc_src/cmds/return.rst index 3ad6cc315..86b1202de 100644 --- a/sphinx_doc_src/cmds/return.rst +++ b/sphinx_doc_src/cmds/return.rst @@ -14,7 +14,7 @@ Description ``return`` halts a currently running function. The exit status is set to ``STATUS`` if it is given. -It is usually added inside of a conditional block such as an if statement or a switch statement to conditionally stop the executing function and return to the caller, but it can also be used to specify the exit status of a function. +It is usually added inside of a conditional block such as an :ref:`if ` statement or a :ref:`switch ` statement to conditionally stop the executing function and return to the caller, but it can also be used to specify the exit status of a function. Example diff --git a/sphinx_doc_src/cmds/while.rst b/sphinx_doc_src/cmds/while.rst index 0bc41f9d8..78d3c77d5 100644 --- a/sphinx_doc_src/cmds/while.rst +++ b/sphinx_doc_src/cmds/while.rst @@ -16,7 +16,7 @@ Description The exit status of the while loop is the exit status of the last iteration of the ``COMMANDS`` executed, or 0 if none were executed. (This matches other shells and is POSIX-compatible.) -You can use ``and`` or ``or`` for complex conditions. Even more complex control can be achieved with ``while true`` containing a break. +You can use :ref:`and ` or :ref:`or ` for complex conditions. Even more complex control can be achieved with ``while true`` containing a :ref:`break `. Example -------