diff --git a/doc_src/cmds/begin.rst b/doc_src/cmds/begin.rst index 9496a86e0..b670faa18 100644 --- a/doc_src/cmds/begin.rst +++ b/doc_src/cmds/begin.rst @@ -6,7 +6,7 @@ begin - start a new block of code Synopsis -------- -``begin``; [*COMMANDS* ...]; ``end`` +**begin**; [*COMMANDS* ...]; **end** Description ----------- diff --git a/doc_src/cmds/block.rst b/doc_src/cmds/block.rst index 0a0bb7072..8e2f4e6ec 100644 --- a/doc_src/cmds/block.rst +++ b/doc_src/cmds/block.rst @@ -6,8 +6,7 @@ block - temporarily block delivery of events Synopsis -------- -``block`` [*OPTIONS* ...] - +**block** [*OPTIONS* ...] Description ----------- diff --git a/doc_src/cmds/builtin.rst b/doc_src/cmds/builtin.rst index 400b741c8..7a782a4ea 100644 --- a/doc_src/cmds/builtin.rst +++ b/doc_src/cmds/builtin.rst @@ -6,8 +6,8 @@ builtin - run a builtin command Synopsis -------- -| ``builtin`` [*OPTIONS* ...] *BUILTINNAME* -| ``builtin`` --query *BUILTINNAMES* ... +| **builtin** [*OPTIONS* ...] *BUILTINNAME* +| **builtin** --query *BUILTINNAMES* ... Description ----------- diff --git a/doc_src/cmds/case.rst b/doc_src/cmds/case.rst index 99777ca55..1b8ef0b59 100644 --- a/doc_src/cmds/case.rst +++ b/doc_src/cmds/case.rst @@ -6,10 +6,10 @@ case - conditionally execute a block of commands Synopsis -------- -| ``switch`` *VALUE* -| [``case`` [*GLOB*...] +| **switch** *VALUE* +| [**case** [*GLOB*...] | [*COMMAND* ...]] -| ``end`` +| **end** Description ----------- diff --git a/doc_src/cmds/cdh.rst b/doc_src/cmds/cdh.rst index ab039783d..d85a494fd 100644 --- a/doc_src/cmds/cdh.rst +++ b/doc_src/cmds/cdh.rst @@ -6,7 +6,7 @@ cdh - change to a recently visited directory Synopsis -------- -``cdh`` [ *DIR* ] +``cdh`` [*DIR*] Description ----------- diff --git a/doc_src/cmds/commandline.rst b/doc_src/cmds/commandline.rst index 345b9476e..b58835944 100644 --- a/doc_src/cmds/commandline.rst +++ b/doc_src/cmds/commandline.rst @@ -6,7 +6,7 @@ commandline - set or get the current command line buffer Synopsis -------- -``commandline`` [**OPTIONS**] [**CMD**] +``commandline`` [*OPTIONS*] [*CMD*] Description ----------- diff --git a/doc_src/cmds/contains.rst b/doc_src/cmds/contains.rst index e50a1abb5..283c765b3 100644 --- a/doc_src/cmds/contains.rst +++ b/doc_src/cmds/contains.rst @@ -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. diff --git a/doc_src/cmds/continue.rst b/doc_src/cmds/continue.rst index 6466e8447..b245057c5 100644 --- a/doc_src/cmds/continue.rst +++ b/doc_src/cmds/continue.rst @@ -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 ----------- diff --git a/doc_src/cmds/disown.rst b/doc_src/cmds/disown.rst index b47780926..864fed62c 100644 --- a/doc_src/cmds/disown.rst +++ b/doc_src/cmds/disown.rst @@ -6,7 +6,7 @@ disown - remove a process from the list of jobs Synopsis -------- -disown [ **PID** ... ] +``disown`` [ **PID** ... ] Description ----------- diff --git a/doc_src/cmds/else.rst b/doc_src/cmds/else.rst index 17e498ecd..93edfbce8 100644 --- a/doc_src/cmds/else.rst +++ b/doc_src/cmds/else.rst @@ -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 ` will execute the command **CONDITION**. +:ref:`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 diff --git a/doc_src/cmds/eval.rst b/doc_src/cmds/eval.rst index 0f30ddeaf..8434298db 100644 --- a/doc_src/cmds/eval.rst +++ b/doc_src/cmds/eval.rst @@ -8,7 +8,6 @@ Synopsis **eval** [*COMMANDS*...] - Description ----------- **eval** evaluates the specified parameters as a command. diff --git a/doc_src/cmds/exit.rst b/doc_src/cmds/exit.rst index 9121f6ee2..8ff971896 100644 --- a/doc_src/cmds/exit.rst +++ b/doc_src/cmds/exit.rst @@ -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 ` builtin) the rest of the file will be skipped, but the shell itself will not exit. diff --git a/doc_src/cmds/fg.rst b/doc_src/cmds/fg.rst index 98605a63c..6bf4be662 100644 --- a/doc_src/cmds/fg.rst +++ b/doc_src/cmds/fg.rst @@ -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 `. Example diff --git a/doc_src/cmds/fish.rst b/doc_src/cmds/fish.rst index e1f8fe82b..02a4a2adb 100644 --- a/doc_src/cmds/fish.rst +++ b/doc_src/cmds/fish.rst @@ -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 ` 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 ` below for details. +**-d** or **--debug=DEBUG_CATEGORIES** + Enables debug output and specify a pattern for matching debug categories. + See :ref:`Debugging ` 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 `, so fish will not access old or store new history. +**-P** or **--private** + Enables :ref:`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 ` (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 `. -The fish exit status is generally the :ref:`exit status of the last foreground command `. +The ``fish`` exit status is generally the :ref:`exit status of the last foreground command `. .. _debugging-fish: @@ -61,24 +77,24 @@ Debugging --------- While fish provides extensive support for :ref:`debugging fish scripts `, 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`. diff --git a/doc_src/cmds/fish_add_path.rst b/doc_src/cmds/fish_add_path.rst index 9dd367ebf..e81e5ee20 100644 --- a/doc_src/cmds/fish_add_path.rst +++ b/doc_src/cmds/fish_add_path.rst @@ -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 diff --git a/doc_src/cmds/fish_breakpoint_prompt.rst b/doc_src/cmds/fish_breakpoint_prompt.rst index e6e2381c4..8eeb4025c 100644 --- a/doc_src/cmds/fish_breakpoint_prompt.rst +++ b/doc_src/cmds/fish_breakpoint_prompt.rst @@ -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 diff --git a/doc_src/cmds/fish_command_not_found.rst b/doc_src/cmds/fish_command_not_found.rst index cdc0b6fa7..bed9071e8 100644 --- a/doc_src/cmds/fish_command_not_found.rst +++ b/doc_src/cmds/fish_command_not_found.rst @@ -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 diff --git a/doc_src/cmds/fish_config.rst b/doc_src/cmds/fish_config.rst index ef26fabce..08503d723 100644 --- a/doc_src/cmds/fish_config.rst +++ b/doc_src/cmds/fish_config.rst @@ -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 ----------- diff --git a/doc_src/cmds/fish_git_prompt.rst b/doc_src/cmds/fish_git_prompt.rst index 48dd15ac6..88b0dadfa 100644 --- a/doc_src/cmds/fish_git_prompt.rst +++ b/doc_src/cmds/fish_git_prompt.rst @@ -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 ----------- diff --git a/doc_src/cmds/fish_greeting.rst b/doc_src/cmds/fish_greeting.rst index f79e67276..722addee8 100644 --- a/doc_src/cmds/fish_greeting.rst +++ b/doc_src/cmds/fish_greeting.rst @@ -6,6 +6,7 @@ fish_greeting - display a welcome message in interactive shells Synopsis -------- +**fish_greeting** :: function fish_greeting diff --git a/doc_src/cmds/fish_hg_prompt.rst b/doc_src/cmds/fish_hg_prompt.rst index e44a36630..8db66c21c 100644 --- a/doc_src/cmds/fish_hg_prompt.rst +++ b/doc_src/cmds/fish_hg_prompt.rst @@ -6,6 +6,7 @@ fish_hg_prompt - output Mercurial information for use in a prompt Synopsis -------- +**fish_hg_prompt** :: function fish_prompt diff --git a/doc_src/cmds/fish_is_root_user.rst b/doc_src/cmds/fish_is_root_user.rst index 106b4c1dc..45c030a89 100644 --- a/doc_src/cmds/fish_is_root_user.rst +++ b/doc_src/cmds/fish_is_root_user.rst @@ -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 ----------- diff --git a/doc_src/cmds/fish_key_reader.rst b/doc_src/cmds/fish_key_reader.rst index 956e81b76..32074a63c 100644 --- a/doc_src/cmds/fish_key_reader.rst +++ b/doc_src/cmds/fish_key_reader.rst @@ -6,9 +6,7 @@ fish_key_reader - explore what characters keyboard keys send Synopsis -------- -:: - - fish_key_reader [OPTIONS] +**fish_key_reader** [*OPTIONS*] Description ----------- diff --git a/doc_src/cmds/fish_mode_prompt.rst b/doc_src/cmds/fish_mode_prompt.rst index d5ab35655..62ffa09b9 100644 --- a/doc_src/cmds/fish_mode_prompt.rst +++ b/doc_src/cmds/fish_mode_prompt.rst @@ -6,6 +6,7 @@ fish_mode_prompt - define the appearance of the mode indicator Synopsis -------- +**fish_mode_prompt** :: function fish_mode_prompt diff --git a/doc_src/cmds/fish_opt.rst b/doc_src/cmds/fish_opt.rst index ea1d93456..2e437a5a2 100644 --- a/doc_src/cmds/fish_opt.rst +++ b/doc_src/cmds/fish_opt.rst @@ -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 ----------- diff --git a/doc_src/cmds/fish_prompt.rst b/doc_src/cmds/fish_prompt.rst index e8df810b7..74ace8422 100644 --- a/doc_src/cmds/fish_prompt.rst +++ b/doc_src/cmds/fish_prompt.rst @@ -6,6 +6,7 @@ fish_prompt - define the appearance of the command line prompt Synopsis -------- +``fish_prompt`` :: function fish_prompt diff --git a/doc_src/cmds/fish_status_to_signal.rst b/doc_src/cmds/fish_status_to_signal.rst index cf067e829..2ef79dee0 100644 --- a/doc_src/cmds/fish_status_to_signal.rst +++ b/doc_src/cmds/fish_status_to_signal.rst @@ -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 \ No newline at end of file + SIGINT diff --git a/doc_src/cmds/fish_svn_prompt.rst b/doc_src/cmds/fish_svn_prompt.rst index c9c5b6190..589faf9cb 100644 --- a/doc_src/cmds/fish_svn_prompt.rst +++ b/doc_src/cmds/fish_svn_prompt.rst @@ -6,6 +6,7 @@ fish_svn_prompt - output Subversion information for use in a prompt Synopsis -------- +``fish_svn_prompt`` :: function fish_prompt diff --git a/doc_src/cmds/fish_title.rst b/doc_src/cmds/fish_title.rst index 1ac790ff0..7c4046a1f 100644 --- a/doc_src/cmds/fish_title.rst +++ b/doc_src/cmds/fish_title.rst @@ -6,6 +6,7 @@ fish_title - define the terminal's title Synopsis -------- +``fish_title`` :: function fish_title diff --git a/doc_src/cmds/fish_update_completions.rst b/doc_src/cmds/fish_update_completions.rst index 3651aa0d1..b8d155dbb 100644 --- a/doc_src/cmds/fish_update_completions.rst +++ b/doc_src/cmds/fish_update_completions.rst @@ -6,9 +6,7 @@ fish_update_completions - update completions using manual pages Synopsis -------- -:: - - fish_update_completions +``fish_update_completions`` Description ----------- diff --git a/doc_src/cmds/fish_vcs_prompt.rst b/doc_src/cmds/fish_vcs_prompt.rst index 3921e0ead..9e5da1be0 100644 --- a/doc_src/cmds/fish_vcs_prompt.rst +++ b/doc_src/cmds/fish_vcs_prompt.rst @@ -6,6 +6,7 @@ fish_vcs_prompt - output version control system information for use in a prompt Synopsis -------- +``fish_vcs_prompt`` :: function fish_prompt diff --git a/doc_src/cmds/for.rst b/doc_src/cmds/for.rst index 3e472cde4..99369b7d0 100644 --- a/doc_src/cmds/for.rst +++ b/doc_src/cmds/for.rst @@ -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 `, ``for`` does not modify $status, but the evaluation of its subordinate commands can. +Much like :ref:`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 diff --git a/doc_src/cmds/funced.rst b/doc_src/cmds/funced.rst index e49194d09..b78920b01 100644 --- a/doc_src/cmds/funced.rst +++ b/doc_src/cmds/funced.rst @@ -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``). diff --git a/doc_src/cmds/funcsave.rst b/doc_src/cmds/funcsave.rst index ca5035567..bc4d70e43 100644 --- a/doc_src/cmds/funcsave.rst +++ b/doc_src/cmds/funcsave.rst @@ -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 diff --git a/doc_src/cmds/function.rst b/doc_src/cmds/function.rst index 4e3b938da..0e5b9dce5 100644 --- a/doc_src/cmds/function.rst +++ b/doc_src/cmds/function.rst @@ -6,9 +6,7 @@ function - create a function Synopsis -------- -:: - - function NAME [OPTIONS]; BODY; end +**function** *NAME* [*OPTIONS*]; BODY ...; **end** Description diff --git a/doc_src/cmds/functions.rst b/doc_src/cmds/functions.rst index 947644b67..5bbdd2c14 100644 --- a/doc_src/cmds/functions.rst +++ b/doc_src/cmds/functions.rst @@ -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 -----------