iprithv commented on code in PR #5337:
URL: https://github.com/apache/solr/pull/5337#discussion_r4647315911


##########
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])

Review Comment:
   commons-cli only has the old snapshot-* tools. picocli already does `solr 
snapshot` like zk/package



-- 
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]

Reply via email to