epugh commented on code in PR #2820:
URL: https://github.com/apache/solr/pull/2820#discussion_r1824235207
##########
solr/core/src/java/org/apache/solr/cli/ApiTool.java:
##########
@@ -57,37 +56,19 @@ public List<Option> getOptions() {
.longOpt("solr-url")
.argName("URL")
.hasArg()
- .required(false) // swap back to required when we eliminate
deprecated option
- .desc("Send a GET request to a Solr API endpoint.")
- .build(),
- Option.builder("get")
- .longOpt("get")
- .deprecated(
- DeprecatedAttributes.builder()
- .setForRemoval(true)
- .setSince("9.7")
- .setDescription("Use --solr-url instead")
- .get())
- .argName("URL")
- .hasArg()
- .required(false)
+ .required(true)
.desc("Send a GET request to a Solr API endpoint.")
.build(),
SolrCLI.OPTION_CREDENTIALS);
}
@Override
public void runImpl(CommandLine cli) throws Exception {
- String response = null;
- String getUrl =
- cli.hasOption("solr-url") ? cli.getOptionValue("solr-url") :
cli.getOptionValue("get");
- if (getUrl != null) {
- response = callGet(getUrl,
cli.getOptionValue(SolrCLI.OPTION_CREDENTIALS.getLongOpt()));
- }
- if (response != null) {
- // pretty-print the response to stdout
- echo(response);
- }
+ String getUrl = cli.getOptionValue("solr-url");
+ String response = callGet(getUrl,
cli.getOptionValue(SolrCLI.OPTION_CREDENTIALS.getLongOpt()));
+
+ // pretty-print the response to stdout
+ echo(response);
Review Comment:
or a bats test!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]