From 9c44a47fe7551e67740e283f13433e1f63498765 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Sun, 29 Sep 2024 08:03:50 -0400 Subject: [PATCH] Forward port PR#2727 --- solr/core/src/java/org/apache/solr/cli/SolrCLI.java | 6 +++--- solr/packaging/test/test_version.bats | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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 3b09ee91cce..34d09249a79 100755 --- a/solr/core/src/java/org/apache/solr/cli/SolrCLI.java +++ b/solr/core/src/java/org/apache/solr/cli/SolrCLI.java @@ -201,12 +201,12 @@ public static void main(String[] args) throws Exception { if (Arrays.asList("-version", "version").contains(args[0])) { // select the version tool to be run - CLIO.out("Deprecated operation as of 9.8. Please use -v or --version."); - args[0] = "version"; + CLIO.out("Deprecated operation as of 9.8. Please use bin/solr --version."); + args = new String[] {"version"}; } if (Arrays.asList("-v", "--version").contains(args[0])) { // select the version tool to be run - args[0] = "version"; + args = new String[] {"version"}; } if (Arrays.asList( "upconfig", "downconfig", "cp", "rm", "mv", "ls", "mkroot", "linkconfig", "updateacls") diff --git a/solr/packaging/test/test_version.bats b/solr/packaging/test/test_version.bats index abaf181eb2f..edfebd34663 100644 --- a/solr/packaging/test/test_version.bats +++ b/solr/packaging/test/test_version.bats @@ -33,10 +33,10 @@ setup() { @test "-version and version both return Solr version and deprecation" { run solr -version assert_output --partial "Solr version is:" - assert_output --partial "Deprecated operation as of 9.8. Please use -v or --version." + assert_output --partial "Deprecated operation as of 9.8. Please use bin/solr --version." run solr version assert_output --partial "Solr version is:" - assert_output --partial "Deprecated operation as of 9.8. Please use -v or --version." + assert_output --partial "Deprecated operation as of 9.8. Please use bin/solr --version." }