epugh commented on code in PR #2725:
URL: https://github.com/apache/solr/pull/2725#discussion_r1829172295


##########
solr/core/src/java/org/apache/solr/cli/ToolBase.java:
##########
@@ -48,9 +52,30 @@ protected void echo(final String msg) {
     stdout.println(msg);
   }
 
+  @Override
+  public Options getAllOptions() {
+    return new Options()
+        .addOption(CommonCLIOptions.HELP_OPTION)
+        .addOption(CommonCLIOptions.VERBOSE_OPTION);
+  }
+
+  @Override
+  public Options getOptions() {
+    Options options = new Options();
+
+    Collection<Option> toolOpts = getAllOptions().getOptions();
+    for (Option toolOpt : toolOpts) {
+      if (!toolOpt.isDeprecated()) {
+        options.addOption(toolOpt);
+      }
+    }
+    return options;
+  }
+
   @Override
   public int runTool(CommandLine cli) throws Exception {
-    verbose = cli.hasOption(SolrCLI.OPTION_VERBOSE.getLongOpt());
+    verbose = cli.hasOption(CommonCLIOptions.VERBOSE_OPTION);

Review Comment:
   This does read nicer!



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to