File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -219,3 +219,19 @@ You can combine ``VALUE_IS_ARRAY`` with ``VALUE_REQUIRED`` or
219
219
Similarly, due to a PHP limitation, there is no way to pass an empty string
220
220
as the value of an option. In ``command --prefix `` and ``command --prefix='' ``
221
221
cases, the value of the ``prefix `` option will be ``null ``.
222
+
223
+ Note that to comply with the `docopt standard `_, long options can specify their
224
+ values after a white space or an ``= `` sign (e.g. ``--iterations 5 `` or
225
+ ``--iterations=5 ``), but short options can only use white spaces or no
226
+ separation at all (e.g. ``-i 5 `` or ``-i5 ``).
227
+
228
+ .. _`docopt standard` : http://docopt.org/
229
+
230
+ .. tip ::
231
+
232
+ While it is possible to use whitespace to separate an option from its value,
233
+ using this form leads to an ambiguity should the option appear before the
234
+ command name. In other words, ``php bin/console --iterations 5 app:greet Fabien ``
235
+ is ambiguous; Symfony would interpret ``5 `` as the command name. To avoid
236
+ this situation, always place options after the command name, or avoid using
237
+ a space to separate the option name from its value.
You can’t perform that action at this time.
0 commit comments