Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ParameterFile support #123

Closed
wants to merge 9 commits into from
Closed

@ParameterFile support #123

wants to merge 9 commits into from

Conversation

SJrX
Copy link

@SJrX SJrX commented Jul 3, 2012

Hello as per this thread (https://groups.google.com/forum/?fromgroups#!topic/jcommander/dE6UyojYiVE) I have implemented support for configuration files. This does not support variable arguments currently, as the method I use to read configuration files is via a Properties object, and it didn't occur to me that I can't have multiple keys.

In short you specify things as

@ParameterFile
@parameter(names="--conf")
File configurationFile;

I did add a Test class, originally I tried with TestNG but because of a few problems A) I couldn't run TestNG in debug mode in Eclipse it would just lock up, and B) It seemed like I had to do something with Maven to actually get the updated files to be tested against, and I didn't know how to do this.

There is still more work to do be done (multiple arity arguments, and a few more tests), but I wanted to get some feedback in the interim.

Steve Ramage added 9 commits July 2, 2012 20:40
This does not support variable arguments currently. Some tests are
currently written in JUnit because I am unable to figure out the
interaction with both Maven, and TestNG.
probably not the best place for it, but it was the easiest), also for
required Parameters changed the output message to be a bit more helpful.
@mkarg
Copy link
Collaborator

mkarg commented Oct 5, 2023

Thank you for this contribution. Frankly spoken, looking at the rather zero comments in the past 10 years (!), it seems there is not much interest in such a feature, and I wonder if it actually should be JCommander's job to build configuration from multiple files (sounds more like what Jakarta Config will do). In the end, JCommander soley is a CLI parser, not an application framework, as the very first line of the docs say: "JCommander is a very small Java framework that makes it trivial to parse command line parameters.".

If nobody objects, I will close this issue in the next days.

@mkarg
Copy link
Collaborator

mkarg commented Dec 17, 2023

Closing as announced two months ago.

@mkarg mkarg closed this Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants