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

Can't handle main argument that is a String as stated in the documentation #461

Open
npeder opened this issue Dec 7, 2018 · 1 comment

Comments

@npeder
Copy link

npeder commented Dec 7, 2018

In the documentation (http://jcommander.org/#_main_parameter) it's stated that:

This parameter can be either a List or a single field (for example a String or a type that has a converter, e.g. File), in which case there needs to be exactly one main parameter.

In the method com.beust.jcommander.JCommander#getMainParameter(java.lang.String) a ParameterException is thrown if the parameter field is not a List type

@remkop
Copy link

remkop commented Dec 21, 2018

You may be interested in picocli. It uses @Option for named options and @Parameters for positional parameters, where both can be strongly typed: https://picocli.info/#_positional_parameters

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

No branches or pull requests

2 participants