Closed adamaveray closed 10 years ago
If you have an option/flag with a hyphen in the middle of its name, Commando accepts it but only parses the received argument's name up to the hyphen.
Example:
<?php $cmd = new Commando\Command(); $cmd->option('basicarg'); $cmd->option('hyphen-arg'); var_dump($cmd['basicarg']); var_dump($cmd['hyphen-arg']);
Calls:
$ php script.php --basicarg hello string(5) "hello" NULL $ php script.php --hyphen-arg hello ERROR: Unknown option, hyphen, specified
it was the regex on the _parseOption method which was accepting underscores but not -. @nategood I didn't see a test to alter. I suppose I could write one to check just this. What do you think?
_parseOption
-
If you have an option/flag with a hyphen in the middle of its name, Commando accepts it but only parses the received argument's name up to the hyphen.
Example:
Calls: