Open jameswithers opened 7 years ago
I also ran into this issue.
You must run the parse
function to parse the args before you can get an options value. It happens that the array access function automatically runs the parse function.
Parsing the arguments can be an expensive operation depending on the command, and the options being used. It is designed to execute lazily, and only once.
use isParsed
to find out if the arguments have been parsed. The option value will not be set yet if it returns false.
echo $command['n]
successfully returns what's passed as-n
, but$command->getOption('n')->getValue()
returns nothing