[ 
https://issues.apache.org/jira/browse/GROOVY-8578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma updated GROOVY-8578:
--------------------------------
    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.
h3. 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.
h3. 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.

  was:
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.

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. 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.


> Add errorWriter property to commons-cli CliBuilder
> --------------------------------------------------
>
>                 Key: GROOVY-8578
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8578
>             Project: Groovy
>          Issue Type: Task
>          Components: command line processing
>            Reporter: Remko Popma
>            Priority: Major
>             Fix For: 2.5.0-rc-3
>
>
> 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.
> h3. 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.
> h3. 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to