nategood / commando

An Elegant CLI Library for PHP
MIT License
798 stars 80 forks source link

Use multiple inputs for options #71

Open inkrement opened 7 years ago

inkrement commented 7 years ago

Is it possible to access/use options with multiple words as input?

somecommand.php --countries usa gb fr

I tried it, but $hello_cmd['countries'] returns just the first (in this case usa).

oliver-la commented 7 years ago

You have to use somecommand.php --countries "usa gb fr" instead. This applies to every CLI application.

There is no "fix" for that. "usa" will be interpreted as flag argument, and the other two are just regular arguments.

Rockburner commented 5 years ago

Lots of CLI scripts allow multiple instances of a 'flag' (as opposed to an option) to be passed. eg: $ command.php -p primary -a first-alternate -a second-alternate -a third-alternate -c third-option Commando doesn't seem to allow this, but it would be very useful if anyone was going to look into it?