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
Currently, if a CommandSpec is constructed programmatically, each option and positional parameter by default has an ObjectBinding where the value(s) matched on the command line is/are stored.
These values should be reset to their initial value every time before new input is parsed.
Note that in most cases this is not a problem since the interpreter already keeps track of whether an option has previously been seen or not, and initializes a new Collection or Map the first time the option or positional parameter is encountered.
However, it is best to call option.setValue(option.initialValue()) for all options and positional parameters so there is consistent behaviour for all types, not just java.util classes.
The text was updated successfully, but these errors were encountered:
remkop
changed the title
Interpreter should clear ObjectBinding before parsing new input
Interpreter should reset options and positional parameters to their initial value before parsing new input
Apr 12, 2018
Currently, if a
CommandSpec
is constructed programmatically, each option and positional parameter by default has anObjectBinding
where the value(s) matched on the command line is/are stored.These values should be reset to their initial value every time before new input is parsed.
Note that in most cases this is not a problem since the interpreter already keeps track of whether an option has previously been seen or not, and initializes a new Collection or Map the first time the option or positional parameter is encountered.
However, it is best to call
option.setValue(option.initialValue())
for all options and positional parameters so there is consistent behaviour for all types, not justjava.util
classes.The text was updated successfully, but these errors were encountered: