Skip to content

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! :-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Asriter Could you please respond to the open question? Thanks! 😃

@mkarg mkarg marked this pull request as draft April 27, 2024 09:25
@mkarg mkarg force-pushed the master branch 2 times, most recently from 4dbceb5 to a1d8505 Compare October 5, 2025 13:50
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