jaykay12 commented on code in PR #4739:
URL: https://github.com/apache/solr/pull/4739#discussion_r4172978585
##########
solr/core/src/java/org/apache/solr/cli/PackageTool.java:
##########
@@ -93,6 +117,75 @@ public class PackageTool extends ToolBase {
.desc("Don't prompt for input; accept all default choices, defaults
to false.")
.get();
+ record PackageFlags(
+ String collections,
+ boolean cluster,
+ String[] parameters,
+ boolean update,
+ String collection,
+ boolean noPrompt) {}
+
+ // --- picocli fields ---
+
+ @picocli.CommandLine.ArgGroup(exclusive = true, multiplicity = "0..1")
+ private ConnectionOptions connectionOptions;
+
+ @picocli.CommandLine.Mixin private CredentialsOptions credentialsOptions;
+
+ @picocli.CommandLine.Parameters(
+ index = "0",
+ arity = "1",
+ paramLabel = "COMMAND",
+ description =
+ "Package command: add-repo, add-key, list-installed, list-available,
list-deployed, install, deploy, undeploy, uninstall.")
+ private String cmd;
+
+ @picocli.CommandLine.Parameters(
+ index = "1..*",
+ arity = "0..*",
+ paramLabel = "ARGS",
+ description =
+ "Command-specific arguments (package name[:version], repository
name/URL, key file, etc.).")
+ private String[] cmdArgs;
+
+ @picocli.CommandLine.Option(
+ names = {"--collections"},
+ paramLabel = "COLLECTIONS",
+ description =
+ "Specifies that this action should affect plugins for the given
collections only, excluding cluster level plugins.")
+ private String collections;
+
+ @picocli.CommandLine.Option(
+ names = {"--cluster"},
+ description = "Specifies that this action should affect cluster-level
plugins only.")
+ private boolean cluster;
+
+ @picocli.CommandLine.Option(
+ names = {"--param"},
+ paramLabel = "PARAMS",
+ description = "List of parameters to be used with the deploy command.")
+ private String[] param;
Review Comment:
Now a stray token is a parse error instead of being swallowed.
Kept arity 1 and the documented repeated form (--param a=1 --param b=2).
Also wired -p as the short option, same as commons-cli.
--
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]