Skip to content

Commit 221597a

Browse files
committed
Reworded the explanation about "optional options"
1 parent 1b5fcf0 commit 221597a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

components/console/introduction.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,11 @@ declare a one-letter shortcut that you can call with a single dash like
296296

297297
.. tip::
298298

299-
It may look that it's possible to make an option *optionally* accept a value
300-
(so that ``--yell`` or ``--yell=loud`` work). However, if you call a command
301-
with an option without a value, you'll retrieve ``null`` as the option's value
302-
which is the same when you omit the option. In practice, this means that a
303-
command cannot distinguish between passing an option without a value and not
304-
passing that very same option.
299+
There is nothing forbidding you to create a command with an *optional option*,
300+
which is an input option set to ``InputOption::OPTIONAL`` mode. You will just
301+
not be able to distinguish when the flag for that option was used without a
302+
value (``command --yell``) or when it was not used at all (``command``).
303+
In both cases the value retrieved for the option will be the same ``null``.
305304

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

0 commit comments

Comments
 (0)