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 c585e4f55d2..2dc25b03556 100755 --- a/solr/core/src/java/org/apache/solr/cli/SolrCLI.java +++ b/solr/core/src/java/org/apache/solr/cli/SolrCLI.java @@ -363,6 +363,20 @@ public static String getOptionWithDeprecatedAndDefault( return val == null ? def : val; } + // TODO: SOLR-17429 - remove the custom logic when CommonsCLI is upgraded and + // makes stderr the default, or makes Option.toDeprecatedString() public. + private static void deprecatedHandlerStdErr(Option o) { + if (o.isDeprecated()) { + final StringBuilder buf = + new StringBuilder().append("Option '-").append(o.getOpt()).append('\''); + if (o.getLongOpt() != null) { + buf.append(",'--").append(o.getLongOpt()).append('\''); + } + buf.append(": ").append(o.getDeprecated()); + CLIO.err(buf.toString()); + } + } + /** Parses the command-line arguments passed by the user. */ public static CommandLine processCommandLineArgs(Tool tool, String[] args) { List