-
Notifications
You must be signed in to change notification settings - Fork 333
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
SubCommands #472
Comments
@cbeust Cedric, if you agree about the general benefit of this feature, we would be happy to provide a PR. Can you please deliver your judgement? |
Hi @mkarg, No objection to the idea, but a bit concerned how big that PR would be. Happy to review it. |
@cbeust I will assign this task to a new coder we hired. He could start work on that in Q4. As commands are internally JCommander instances, it shouldn't need to much change, as we could call JCommander.addCommand() on that sub-JCommander instances and let them parse the command in turn. |
@cbeust FYI, today we implemented a PoC for subcommands using unchanged current JCommander, and it worked like a charm. In fact, it works so good that we decided to take the PoC into production. So I think you don't need to worry about the size of the PR. :-) |
That's awesome to hear :) |
@mkarg can you share your PoC? We ended up adding a subcommand with a space in it i.e. "container list" and we were shocked but glad it worked. I was wondering if you took a similar approach or had a different implementation. |
@david-truong https://gist.github.com/mkarg/9d9ca23e6da32b47c7fadaf10ae16ba6 |
Some CLI utilities use multi-word commands alias "Sub Commands":
docker container list <options>
.It would be great if JCommander would support the registration of sub commands with unlimited depth.
The text was updated successfully, but these errors were encountered: