Skip to content

Commit 3081634

Browse files
committed
[symfony#2689] Minor tweaks to new InputArgument::IS_ARRAY details
1 parent ba7fda0 commit 3081634

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

components/console/introduction.rst

+11-5
Original file line numberDiff line numberDiff line change
@@ -241,21 +241,27 @@ argument list::
241241
'Who do you want to greet (separate multiple names with a space)?'
242242
);
243243

244-
You can now access the ``names`` argument as an array::
244+
To use this, just specify as many names as you want:
245+
246+
.. code-block:: bash
247+
248+
$ app/console demo:greet Fabien Ryan Bernhard
249+
250+
You can access the ``names`` argument as an array::
245251

246252
if ($names = $input->getArgument('names')) {
247253
$text .= ' '.implode(', ', $names);
248254
}
249255

250256
There are 3 argument variants you can use:
251257

252-
=========================== =================================================================================================
258+
=========================== ===============================================================================================================
253259
Option Value
254-
=========================== =================================================================================================
260+
=========================== ===============================================================================================================
255261
InputArgument::REQUIRED The argument is required
256262
InputArgument::OPTIONAL The argument is optional and therefore can be omitted
257-
InputArgument::IS_ARRAY Allows to specify an indefinite number of arguments, must be used at the end of the argument list
258-
=========================== =================================================================================================
263+
InputArgument::IS_ARRAY The argument can can contain an indefinite number of arguments and must be used at the end of the argument list
264+
=========================== ===============================================================================================================
259265

260266
You can combine ``IS_ARRAY`` with ``REQUIRED`` and ``OPTIONAL`` like this::
261267

0 commit comments

Comments
 (0)