Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0
-
None
-
None
Description
When ArgumentBuilder.withDefault is called, the default is correctly stored in the internal state. The default is correctly loaded in the WriteableCommandLineImpl.defaultValues. However, if the option is omitted from the arguments to the application, and CommandLine.getValue() is called passing the option's trigger string (without re-specifying the default), then
- WriteableCommandLineImpl.addOption will not have been called, which means
- nameToOption will be missing the option, which means
- getOption will return null, which means
- getValue will return null.
The only workaround to this is to either re-specify the default as a parameter to getValue(), or pass the option object instead of the trigger string.