commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard (Jira)" <>
Subject [jira] [Commented] (CLI-298) Define CLI options via configuration file
Date Thu, 17 Oct 2019 13:49:00 GMT


Richard commented on CLI-298:

Agreed about text file format, for myself with the projects we're working on, once I've completed
this, it will massively reduce code overhead because some of our CLI applications have dozens
of options, and currently about to hit half a dozen for the amount of individual applications
we maintain that use CLI. I'd love to see annotations too but this is more of a priority for
myself at the moment.

Talking of which, how do you folks work here? My current section is now finished, and what's
left (in no strict order) is:

* File corruption/modification detection;
* Add ability to coerce arguments to integers, floating point numbers, dates, files, IP addresses,
URLs along with the ability to create your own builders; on top of this will be the ability
to say that a file must exist, must be a directory, must not exist, check integer value limits
etc. and add all the handling to print back to the user if there's a problem.;
* Expanding on the previous point, the ability to defines options as taking lists of any of
the above e.g. \-\-portNums=80,8080,8081 etc;
* Add I18N since currently the user could be defining text to be output in their native language
but currently errors will be reported in English;

So my question is shall I keep updating this task or create new tasks, also should I treat
this as one pull request or do one per feature update? Happy to conform to your working standards.

> Define CLI options via configuration file
> -----------------------------------------
>                 Key: CLI-298
>                 URL:
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: Options definition
>    Affects Versions: 1.5, Nightly Builds
>            Reporter: Richard
>            Priority: Minor
>              Labels: newbie, pull-request-available, ready-to-commit
>   Original Estimate: 336h
>  Remaining Estimate: 336h
> Create a configuration that enables users to define CLI options via a configuration file.
Such configuration would normally pre-defined and bundled inside the executable jar running
the application. This would reduce the amount of code required to define command line options
and introduce the ability to do a lot of the checking a user does (such as converting values
to integers, files, checking if integers are above/below a certain amount, checking that files
or directories do/don't exist etc.) For security purposes, at compile time calculate an MD5
for the application, if this doesn't match at runtime warn of corrupted file exception. Also
add I18N since this will be driven via the user experience for exception messages.
> So far I've catered for basic options that utilise strings.
> Code already started with a pull request at []
underneath the branch named "cli-configuration".
> Apologies in advance, never contributed to Apache SWF before.

This message was sent by Atlassian Jira

View raw message