groovy-notifications mailing list archives

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

    [ https://issues.apache.org/jira/browse/GROOVY-8520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16416932#comment-16416932
] 

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|https://github.com/remkop/picocli/issues/308]
* (/) Provide CommandLine.usage(PrintWriter) method [307|https://github.com/remkop/picocli/issues/307]
* Provide API to validate max arg count after split [313|https://github.com/remkop/picocli/issues/313]
- to mimic commons-cli validation
* Provide CommandLine.setUsageWidth(int) method [314|https://github.com/remkop/picocli/issues/314]
- functionality exists but is not exposed as API
* Apply type conversion on ArgSpec.defaultValue [315|https://github.com/remkop/picocli/issues/315]
* Lenient mode for extracting annotations [316|https://github.com/remkop/picocli/issues/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: https://issues.apache.org/jira/browse/GROOVY-8520
>             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|https://lists.apache.org/thread.html/d60b6d5d4411e9ba0d7dc209cde8a9bb4abb00f0b9c0322f068c322e@%3Cdev.groovy.apache.org%3E]
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
(v7.6.3#76005)

Mime
View raw message