You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that if an option with InputOption::VALUE_NONE is not set, its default value is false. This in turns, mean that when we merge the input into the configuration, the false value overrides whatever value was set for that option.
Edit: After thinking about this issue for a bit, I've realized that this can be generalized to the fact that we will be unable to properly merge the command line options if they have default values other than null since InputMerger relies on them being null by default to decide if they should take the value of the configuration (if any).
The text was updated successfully, but these errors were encountered:
@nochso But that means that every time we modify a command, we'd have to be aware that InputOption::VALUE_NONE will not work as expected with configuration files. I don't like that.
After looking a bit at Symfony's InputInterface, it doesn't seem like there is any way to tell if an option was set or not since if it is not set, it will return us its default value... See symfony/symfony#8486
It appears that if an option with
InputOption::VALUE_NONE
is not set, its default value isfalse
. This in turns, mean that when we merge theinput
into the configuration, thefalse
value overrides whatever value was set for that option.Edit: After thinking about this issue for a bit, I've realized that this can be generalized to the fact that we will be unable to properly merge the command line options if they have default values other than null since
InputMerger
relies on them beingnull
by default to decide if they should take the value of the configuration (if any).The text was updated successfully, but these errors were encountered: