broadinstitute / barclay

Command line argument parser and online documentation generation utilities for java command line programs.
BSD 3-Clause "New" or "Revised" License
8 stars 6 forks source link

CLP doesn't distinguish between programmatically set value and user-specified value #23

Open magicDGS opened 7 years ago

magicDGS commented 7 years ago

Because they cannot be null, they are always treated as optional by the CLP.

cmnbroad commented 7 years ago

There are two side-effects of this. First, as mentioned above, arguments that have primitive types are never flagged by the parser as not having been set, even if they're required, because the parser always views them as having a value, even if it was set programmatically.

Second, if affects plugins such as the read filter plugin because the parser presents the argument to the plugin as having been supplied (via a call to isDependentArgumentAllowed). This is problematic when the value was actually supplied as a default value for a default plugin by the tool, but the user want to disable the filter. During validation, the plugin will complain that an argument value was supplied for a filter that is also being disabled, even though the user didn't supply the argument value.