clarax commented on code in PR #105:
URL: 
https://github.com/apache/hbase-operator-tools/pull/105#discussion_r846674726


##########
hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java:
##########
@@ -384,27 +439,29 @@ int setRegionState(ClusterConnection connection, String 
region, int replicaId,
     options.addOption(recursive);
     Option wait = 
Option.builder("w").longOpt("lockWait").hasArg().type(Integer.class).build();
     options.addOption(wait);
+    Option inputFile = Option.builder("i").longOpt("inputFiles").build();
+    options.addOption(inputFile);
     // Parse command-line.
-    CommandLineParser parser = new DefaultParser();
-    CommandLine commandLine;
-    try {
-      commandLine = parser.parse(options, args, false);
-    } catch (ParseException e) {
-      showErrorMessage(e.getMessage());
+    CommandLine commandLine = getCommandLine(args, options);
+    if (commandLine == null) {
       return null;
     }
     long lockWait = DEFAULT_LOCK_WAIT;
     if (commandLine.hasOption(wait.getOpt())) {
       lockWait = Integer.parseInt(commandLine.getOptionValue(wait.getOpt()));
     }
-    String[] pidStrs = commandLine.getArgs();
+    boolean overrideFlag = commandLine.hasOption(override.getOpt());
+    boolean recursiveFlag = commandLine.hasOption(recursive.getOpt());
+    boolean inputFileFlag = commandLine.hasOption(inputFile.getOpt());
+
+    String[] pidStrs =getFromArgsOrFiles(commandLine.getArgList(), 
inputFileFlag)

Review Comment:
   I had tested bypass with input files. Not sure why your IntelliJ complains.  
Just added a unit test too. Also passed. 



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