rmdmattingly commented on code in PR #143:
URL: 
https://github.com/apache/hbase-operator-tools/pull/143#discussion_r1626406988


##########
hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java:
##########
@@ -1507,22 +1577,39 @@ private Pair<CommandLine, List<String>> 
parseCommandWithFixAndInputOptions(Strin
     return Pair.newPair(commandLine, params);
   }
 
+  private boolean commandHasHelpOption(String[] args) {
+    args = purgeFirst(args);
+    Options options = new Options();
+    Option helpOption =
+      Option.builder("h").longOpt("help").desc("help message for a 
command").build();
+
+    options.addOption(helpOption);
+    CommandLine test = getCommandLine(args, options, false);
+    return test != null && test.hasOption(helpOption.getOpt());
+  }
+
   /**
    * Get a commandLine object with options and a arg list
    */
-  private CommandLine getCommandLine(String[] args, Options options) {
+  private CommandLine getCommandLine(String[] args, Options options, boolean 
showException) {
     // Parse command-line.
     CommandLineParser parser = new DefaultParser();
     CommandLine commandLine;
     try {
       commandLine = parser.parse(options, args, false);
     } catch (ParseException e) {
-      showErrorMessage(e.getMessage());
+      if (showException) {
+        showErrorMessage(e.getMessage());
+      }
       return null;
     }
     return commandLine;
   }
 
+  private CommandLine getCommandLine(String[] args, Options options) {
+    return getCommandLine(args, options, true);
+  }

Review Comment:
   is this used?



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

Reply via email to