Skip to content

Commit e9b9376

Browse files
committed
bug #5009 Reworded the explanation about optional command options (javiereguiluz)
This PR was merged into the 2.3 branch. Discussion ---------- Reworded the explanation about optional command options | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | #4110 Commits ------- 89029cd Reworded again the note about "optional options" 221597a Reworded the explanation about "optional options" 1b5fcf0 Reworded the explanation about optional command options
2 parents 07cb14b + 89029cd commit e9b9376

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/console/introduction.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,11 @@ declare a one-letter shortcut that you can call with a single dash like
296296

297297
.. tip::
298298

299-
It is also possible to make an option *optionally* accept a value (so that
300-
``--yell``, ``--yell=loud`` or ``--yell loud`` work). Options can also be configured to
301-
accept an array of values.
299+
There is nothing forbidding you to create a command with an option that
300+
optionally accepts a value. However, there is no way you can distinguish
301+
when the option was used without a value (``command --yell``) or when it
302+
wasn't used at all (``command``). In both cases, the value retrieved for
303+
the option will be ``null``.
302304

303305
For example, add a new option to the command that can be used to specify
304306
how many times in a row the message should be printed::

0 commit comments

Comments
 (0)