Open natebosch opened 4 years ago
I've run into other issues with how eager ArgParser and CommandRunner is about pinning things down. In particular, it is surprisingly hard to gracefully handle help options that only show up when --verbose
is passed. At some point, we may want to consider a more just-in-time API for generating help/usage information that takes a few parameters instead of having to bake everything when you create the ArgParser.
We allow passing a
usageLineLength
toArgParser
orCommandRunner
in the constructor. In both cases the field isfinal
and is read internally by theusage
getter. This means that the wrapping needs to be decided before the arguments are parsed, so parsed arguments can't be used to inform the line length.The most immediate option I can think of is to change
usageLineLength
from afinal
field to a settable field, and then the option that controls wrapping would pass acallback
that sets the field on the parser.