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

Does Jcommander support parse args into multiple sub command #570

Open
ruanwenjun opened this issue Oct 24, 2023 · 4 comments
Open

Does Jcommander support parse args into multiple sub command #570

ruanwenjun opened this issue Oct 24, 2023 · 4 comments

Comments

@ruanwenjun
Copy link

In my usage, I hope to parse the input args into some sub command.
e.g.
The input looks like

-i iArgs -o oArgs -p pArgs

And I have Three sub command ICommand, OCommand, PCommand, I hope JCommand receive args, and can return ICommand, OCommand, PCommand or return only one command which order is higher.

@mkarg
Copy link
Collaborator

mkarg commented Oct 25, 2023

Have you read the docs? Have you tried it out?

@ruanwenjun
Copy link
Author

Have you read the docs? Have you tried it out?

I have read the doc, find I can add sub command by following way
image

In this way, I need to create subcommand object first and check each after parsed, I am not sure if there exist other better way.

@mkarg
Copy link
Collaborator

mkarg commented Oct 26, 2023

Can you please rewrite your test in a way that demonstrates what you like to do instead of the above code, and can you please outline why your intended solution would be easier/better/superior? That makes it easier for us to understand if/why/how to change JCommander's API. :-)

BTW, there is no need to paste JPGs. In fact, it makes it harder for us to copy-paste your demo code. If you could use backticks to markup plain text we would be able to try out your code without the need to transcripe it from the JPG. Thanks.

@mkarg
Copy link
Collaborator

mkarg commented Apr 27, 2024

@ruanwenjun Still looking forward to receive your answer in the current discussion! :-)

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