mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 15:14:44 +00:00
Document that break cannot be used in switch
This commit is contained in:
parent
d5561623aa
commit
ee1018ab53
2 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,7 @@ Synopsis
|
|||
Description
|
||||
-----------
|
||||
|
||||
``break`` halts a currently running loop (*LOOP_CONSTRUCT*), 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.
|
||||
``break`` halts a currently running loop (*LOOP_CONSTRUCT*), such as a :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``.
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ Each ``case`` command is given one or more parameters. The first ``case`` comman
|
|||
|
||||
Note that fish does not fall through on case statements. Only the first matching case is executed.
|
||||
|
||||
Note that :ref:`break <cmd-break>` cannot be used to exit a case/switch block early like in other languages. It can only be used in loops.
|
||||
|
||||
Note that command substitutions in a case statement will be evaluated even if its body is not taken. All substitutions, including command substitutions, must be performed before the value can be compared against the parameter.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue