Skip to content

Support collecting all values of valued arguments

Thomas Flori requested to merge github/fork/mbaynton/multi-arg into master

Created by: mbaynton

Support collecting all values of valued arguments when they are specified multiple times.

So, you can make a new Option('a', null, GetOpt::REQUIRED_ARGUMENT | GetOpt::MULTIPLE_ARGUMENT). Then for

./my-script.php -a str1 -a str2

the option value for option a is an array containing all values that were provided.

Merge request reports