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
I want to use two parameters on a command, somehow like this:
program.option("-d, --debug","overwrite debug configuration with 'true'").option("-n, --no-debug","overwrite debug configuration with 'false'");
My program has a configuration file, where a default value for debug is defined. The parameters -d and -n should override this setting, but only when set. If not set the default value should be picked. So for example:
Default value for debug in configuration is true:
command <- debug is enabled
command -d <- debug is enabled
command -n <- debug is disabled
Default value for debug in configuration is false:
command <- debug is disabled
command -d <- debug is enabled
command -n <- debug is disabled
The problem is, when using a --no- parameter, commander always set a default value for debug and there is no way to see, if one of those options was set while execute the command. I would need a way to see if -d or -n was really given by the user.
Otherwise, it will always overwrite my configuration and not only when the user want to do it especially.
The text was updated successfully, but these errors were encountered:
Hello,
I want to use two parameters on a command, somehow like this:
My program has a configuration file, where a default value for
debug
is defined. The parameters-d
and-n
should override this setting, but only when set. If not set the default value should be picked. So for example:Default value for
debug
in configuration istrue
:Default value for
debug
in configuration isfalse
:The problem is, when using a
--no-
parameter,commander
always set a default value fordebug
and there is no way to see, if one of those options was set while execute the command. I would need a way to see if-d
or-n
was really given by the user.Otherwise, it will always overwrite my configuration and not only when the user want to do it especially.
The text was updated successfully, but these errors were encountered: