@@ -241,21 +241,27 @@ argument list::
241
241
'Who do you want to greet (separate multiple names with a space)?'
242
242
);
243
243
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::
245
251
246
252
if ($names = $input->getArgument('names')) {
247
253
$text .= ' '.implode(', ', $names);
248
254
}
249
255
250
256
There are 3 argument variants you can use:
251
257
252
- =========================== =================================================================================================
258
+ =========================== ===============================================================================================================
253
259
Option Value
254
- =========================== =================================================================================================
260
+ =========================== ===============================================================================================================
255
261
InputArgument::REQUIRED The argument is required
256
262
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
+ =========================== ===============================================================================================================
259
265
260
266
You can combine ``IS_ARRAY `` with ``REQUIRED `` and ``OPTIONAL `` like this::
261
267
0 commit comments