argparse4j
argparse4j copied to clipboard
Default value help formatting gives inappropriate result in some common cases.
parser.addArgument("-o", "--output")
.type(FileOutputStream.class)
.setDefault(System.out)
.metavar("FILE")
.help("Output file.");
The code above gives this help output:
-o FILE, --output FILE
Output file. (default: java.io.
PrintStream@1b9e1916)
Default value looks broken. For boolean options help string as "(default: false)" not suitable in some cases too. Sometimes it would be better to write "this switch is off by default" or something like that. So more control over help sting formatting is needed in argument definition.