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

fixed issues 445, add a method 'addSubcommand' #522

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Asriter
Copy link

@Asriter Asriter commented May 21, 2021

I fixed the issues #445 and add a method named 'addSubcommand'. It can add a subcommand for the command added by user but the defult command. And the command like 'myprogram command subcommand --flag1 --flag2' can run successfully by calling this method

Asriter added 3 commits April 25, 2021 19:21
In fact, the bug is not caused by the input of these symbols in the argument, but by the "splitter" call that splits the String according to ", ". so the input JSON will be split.
I added a method "JSONCheck" in CommParameterSplitter to determine if the parameter is JSON, and if it is, it will not be split according to ",".
I add a method 'addSubcommand' that add a command for the command added by user but the main command. Use this method, 'myprogram command subcommand --flag1 --flag2' can run successfully.
* @param parentCommand the instance of command that you want to add subcommand
* @param aliases the aliases for the subcommand
**/
public void addSubcommand(String name, Object object, JCommander parentCommand, String... aliases){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand the benefit of this command over the existing possibility of simply calling parentCommand.addCommand() directly.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Asriter Unfortunately you have no responded to my question, so I hope you do not feel discouraged from setting the state of this PR to draft.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Asriter Kindly requsting your response! :-)

@mkarg mkarg marked this pull request as draft April 27, 2024 09:25
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