Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
This ticket proposes to modify the commons-cli version of CliBuilder, so that it also has an errorWriter property that works similar to the picocli version of CliBuilder.
Description of Functionality
The picocli version of CliBuilder has an errorWriter property (System.err by default) that is used to print the error message and usage help to when the user provided invalid input on the command line. This prevents error messages from inadvertently being parsed by another program when the output of a groovy program is piped to another program.
The previously existing writer property is used when the user requests help with -help or -version. This allows users to pipe the output of the help request to less or grep or another utility.
Motivation
- This is a good feature in general (follow conventions for command line applications)
- It makes the commons-cli version and the picocli version of CliBuilder more consistent with each other.
I can raise a PR if there is interest.
Attachments
Issue Links
- relates to
-
GROOVY-8520 Replace commons-cli with picocli in CliBuilder
- Closed