Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-17442: Fix a errant deprecation of --debug and properly look up --verbose (#2732)

Eric Pugh30d34cb95abb
diff --git a/solr/core/src/java/org/apache/solr/cli/AssertTool.java b/solr/core/src/java/org/apache/solr/cli/AssertTool.java
index 73f9cc761b6..dabbe2aaa8d 100644
--- a/solr/core/src/java/org/apache/solr/cli/AssertTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/AssertTool.java
@@ -129,9 +129,18 @@ public class AssertTool extends ToolBase {
SolrCLI.OPTION_CREDENTIALS);
}
+ /**
+ * Returns 100 error code for a true "error", otherwise returns the number of tests that failed.
+ * Otherwise, very similar to the parent runTool method.
+ *
+ * @param cli the command line object
+ * @return 0 on success, or a number corresponding to number of tests that failed, or 100 for a
+ * Error
+ * @throws Exception if a tool failed, e.g. authentication failure
+ */
@Override
public int runTool(CommandLine cli) throws Exception {
- verbose = cli.hasOption(SolrCLI.OPTION_VERBOSE.getOpt());
+ verbose = cli.hasOption(SolrCLI.OPTION_VERBOSE.getLongOpt());
int toolExitStatus;
try {
diff --git a/solr/core/src/java/org/apache/solr/cli/SolrCLI.java b/solr/core/src/java/org/apache/solr/cli/SolrCLI.java
index 34d09249a79..056a7792bb5 100755
--- a/solr/core/src/java/org/apache/solr/cli/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/cli/SolrCLI.java
@@ -147,17 +147,12 @@ public class SolrCLI implements CLIO {
.build();
public static final Option OPTION_VERBOSE =
- Option.builder("v")
+ Option.builder()
.longOpt("verbose")
- .deprecated(
- DeprecatedAttributes.builder()
- .setForRemoval(true)
- .setSince("9.8")
- .setDescription("Use --debug instead")
- .get())
.required(false)
.desc("Enable verbose command output.")
.build();
+
public static final Option OPTION_HELP =
Option.builder("h").longOpt("help").required(false).desc("Print this message.").build();
@@ -320,7 +315,7 @@ public class SolrCLI implements CLIO {
}
public static void raiseLogLevelUnlessVerbose(CommandLine cli) {
- if (!cli.hasOption(SolrCLI.OPTION_VERBOSE.getOpt())) {
+ if (!cli.hasOption(SolrCLI.OPTION_VERBOSE.getLongOpt())) {
StartupLoggingUtils.changeLogLevel("WARN");
}
}
diff --git a/solr/core/src/java/org/apache/solr/cli/ToolBase.java b/solr/core/src/java/org/apache/solr/cli/ToolBase.java
index 715134a9fc4..d35b63e1528 100644
--- a/solr/core/src/java/org/apache/solr/cli/ToolBase.java
+++ b/solr/core/src/java/org/apache/solr/cli/ToolBase.java
@@ -50,7 +50,7 @@ public abstract class ToolBase implements Tool {
@Override
public int runTool(CommandLine cli) throws Exception {
- verbose = cli.hasOption(SolrCLI.OPTION_VERBOSE.getOpt());
+ verbose = cli.hasOption(SolrCLI.OPTION_VERBOSE.getLongOpt());
int toolExitStatus = 0;
try {