commons-issues mailing list archives

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

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

Richard commented on CLI-298:
-----------------------------

OK should I just shelve this and maintain my own version? I don't want to waste your folks
time posting here if you're not keen on my changes. Or I can go silent until I'm finished,
update and you can see if it fits the bill.

You're right about the object model - as I stated, it's about reduction of the amount of code
we write,  using this is an alternative to manually writing code, you just need your configuration
file and about 20-30 lines of code - which is a great reduction of one of our applications.
For example, there's one where the options and definitions with error checking arguments comes
to just over 600 lines, and that's just one application! For all projects combined I imagine
it's several thousand lines.

I'm not sure with my current example posted above that you see the benefit to using this as
an alternative to manually writing options, so feel free to ask questions if you're not sure.
Thanks for the feedback either way.

One important point: I'm not proposing these changes as a new and better way to use CLI -
more that there's an alternative way if one wants to use it.

> Define CLI options via configuration file
> -----------------------------------------
>
>                 Key: CLI-298
>                 URL: https://issues.apache.org/jira/browse/CLI-298
>             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 [https://github.com/zendawg/commons-cli]
underneath the branch named "cli-configuration".
> Apologies in advance, never contributed to Apache SWF before.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message