Skip to content

Commit

Permalink
bug #5009 Reworded the explanation about optional command options (ja…
Browse files Browse the repository at this point in the history
…viereguiluz)

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
  • Loading branch information
weaverryan committed Mar 14, 2015
2 parents 07cb14b + 89029cd commit e9b9376
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ declare a one-letter shortcut that you can call with a single dash like

.. tip::

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

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

0 comments on commit e9b9376

Please sign in to comment.