janhoy commented on code in PR #5039:
URL: https://github.com/apache/solr/pull/5039#discussion_r4205437493


##########
solr/core/src/java/org/apache/solr/cli/ConfigTool.java:
##########
@@ -81,6 +113,68 @@ record ConfigParams(
       String value,
       String credentials) {}
 
+  // --- picocli fields ---
+
+  @picocli.CommandLine.ArgGroup(exclusive = true, multiplicity = "0..1")
+  private ConnectionOptions connectionOptions;
+
+  @picocli.CommandLine.Mixin private CredentialsOptions credentialsOptions;
+
+  @picocli.CommandLine.Option(
+      names = {"-c", "--name"},
+      required = true,
+      paramLabel = "NAME",
+      description = "Name of the collection.")
+  private String nameOpt;
+
+  /** The values of {@code --action}, spelled on the command line as {@link 
#toString()} says. */
+  enum Action {
+    SET_PROPERTY("set-property"),
+    UNSET_PROPERTY("unset-property"),
+    SET_USER_PROPERTY("set-user-property"),
+    UNSET_USER_PROPERTY("unset-user-property");
+
+    private final String id;
+
+    Action(String id) {
+      this.id = id;
+    }
+
+    @Override
+    public String toString() {
+      return id;
+    }
+  }
+
+  @picocli.CommandLine.Option(
+      names = {"-a", "--action"},
+      defaultValue = "set-property",
+      paramLabel = "ACTION",
+      description =
+          "Config API action, one of: ${COMPLETION-CANDIDATES}; default is 
'${DEFAULT-VALUE}'.")
+  private Action actionOpt;
+
+  @picocli.CommandLine.Option(
+      names = "--property",
+      required = true,
+      paramLabel = "PROP",
+      description =
+          "Name of the Config API property to apply the action to, such as:"
+              + " 'updateHandler.autoSoftCommit.maxTime'.")
+  private String propertyOpt;
+
+  // Long-only: "-v" is ToolBase's --verbose, and picocli rejects a duplicate 
short name. Under
+  // commons-cli the later-added VALUE_OPTION wins, so there "-v" still means 
--value.
+  @picocli.CommandLine.Option(
+      names = "--value",

Review Comment:
   The functional change from commons-cli regarding `-v` now not being 
supported perhaps justifies a small note in major-changes-in-solr-10.adoc as a 
breaking change. But that is perhaps better filed in the Solr version where we 
flip `SOLR_PICOCLI` to default to true?



-- 
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]

Reply via email to