fixed issues 445, add a method 'addSubcommand'#522
Draft
Asriter wants to merge 3 commits intocbeust:masterfrom
Draft
fixed issues 445, add a method 'addSubcommand'#522Asriter wants to merge 3 commits intocbeust:masterfrom
Asriter wants to merge 3 commits intocbeust:masterfrom
Conversation
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.
mkarg
reviewed
Dec 22, 2023
| * @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){ |
Collaborator
There was a problem hiding this comment.
I do not understand the benefit of this command over the existing possibility of simply calling parentCommand.addCommand() directly.
Collaborator
There was a problem hiding this comment.
@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.
Collaborator
There was a problem hiding this comment.
@Asriter Could you please respond to the open question? Thanks! 😃
4dbceb5 to
a1d8505
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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