iprithv commented on code in PR #5337:
URL: https://github.com/apache/solr/pull/5337#discussion_r4647326920
##########
solr/core/src/java/org/apache/solr/cli/SolrCLI.java:
##########
@@ -230,9 +230,29 @@ public static int parseWithCommonsCli(String[] args)
throws Exception {
args == null || args.length == 0 || args[0] == null ||
args[0].trim().isEmpty();
final boolean isHelpCommand = !hasNoCommand && Arrays.asList("-h",
"--help").contains(args[0]);
- if (hasNoCommand || isHelpCommand) {
+ if (isHelpCommand) {
printHelp();
- runtime.exit(1);
+ runtime.exit(0);
+ }
+ if (hasNoCommand) {
+ printHelp();
+ runtime.exit(2);
+ }
+
+ boolean missingSubcommand = false;
+
+ if (args.length == 1 && "package".equals(args[0])) {
+ printToolHelp(new PackageTool(runtime));
+ return 2;
+ }
+ if ("snapshot".equals(args[0])
+ && (args.length == 1
+ || (args.length == 2 && Arrays.asList("-h",
"--help").contains(args[1])))) {
+ print(
+ "Snapshot commands: snapshot-create, snapshot-list,
snapshot-describe, "
Review Comment:
picocli already has `solr snapshot create`. only commons-cli is still on the
hyphenated names, maybe a follow-up?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]