groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <>
Subject [jira] [Commented] (GROOVY-8520) Replace commons-cli with picocli in CliBuilder
Date Wed, 28 Mar 2018 07:14:00 GMT


Remko Popma commented on GROOVY-8520:

h3. Task breakdown and status update
(List may change as I discover new work)

h4. picocli changes
* (/) Provide API to disallow POSIX clustered short options [308|]
* (/) Provide CommandLine.usage(PrintWriter) method [307|]
* Provide API to validate max arg count after split [313|]
- to mimic commons-cli validation
* Provide CommandLine.setUsageWidth(int) method [314|]
- functionality exists but is not exposed as API
* Apply type conversion on ArgSpec.defaultValue [315|]
* Lenient mode for extracting annotations [316|]
- allows mixing picocli annotations with {{groovy.cli}} annotations

h4. CliBuilder changes
* (/) Remove CliBuilder properties that expose commons-cli underlying parser
* (/) Replace use of commons-cli Option with picocli OptionSpec
* Convert commons-cli-based Option property names to the equivalent picocli OptionSpec API:
** argName:        {{paramLabel}} (surround by fish brackets in CliBuilder)
** opt, longOpt, shortName:  {{names}} array in picocli OptionSpec
** args, numberOfArguments, numberOfArgumentsString, optionalArg: all map to {{arity}} range
in picocli
** valueSeparator: {{splitRegex}} in OptionSpec
** convert:        {{converters}} in OptionSpec
** type:           same
** required:       same
** defaultValue:   same
* TODO if help is requested, cli should not validate missing required options/parameters.
How does this work in commons-cli?
* Usage help attributes mapping:
** usage - maps to synopsis in picocli
** header - picocli header precedes the synopsis, commons-cli header follows the synopsis.
Map to the {{description}} section which follows the synopsis in picocli
** footer - same
* Other...

h4. Documentation changes
* Remove references to commons-cli underlying parser API
* Document how legacy commons-cli property names are mapped to picocli attributes
* Other...

h4. Tests
Analysis not started yet.

> Replace commons-cli with picocli in CliBuilder
> ----------------------------------------------
>                 Key: GROOVY-8520
>                 URL:
>             Project: Groovy
>          Issue Type: Improvement
>          Components: command line processing
>            Reporter: Remko Popma
>            Priority: Major
> This ticket proposes to replace commons-cli with picocli in {{groovy.util.CliBuilder}}.
> See [discussion on the mailing list|]
for the original proposal and comparison with other CLI libraries.
> Goals for the initial implementation:
> * preserve the current CliBuilder behaviour as much as possible
> * deliver an implementation, tests and documentation in time to be included in the 2.5
GA release

This message was sent by Atlassian JIRA

View raw message