serhiy-bzhezytskyy commented on code in PR #5040:
URL: https://github.com/apache/solr/pull/5040#discussion_r4206941808
##########
solr/core/src/java/org/apache/solr/cli/ExportTool.java:
##########
@@ -149,6 +193,74 @@ record ExportParams(
String fields,
String limit) {}
+ // --- picocli fields ---
+ // The connection group is mandatory (multiplicity "1"): the commons-cli
path throws
+ // IllegalArgumentException when no connection target is given, so ArgGroup
enforces the same
+ // requirement declaratively.
+
+ @picocli.CommandLine.ArgGroup(exclusive = true, multiplicity = "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;
+
+ @picocli.CommandLine.Option(
+ names = "--output",
+ paramLabel = "PATH",
+ description =
+ "Path to output the exported data, and optionally the file name,
defaults to"
+ + " 'collection-name'.")
+ private String outputOpt;
+
+ /** The values of {@code --format}; each constant is spelled as it is on the
command line. */
+ enum Format {
+ json,
+ jsonl,
+ javabin
+ }
+
+ @picocli.CommandLine.Option(
+ names = "--format",
+ paramLabel = "FORMAT",
+ description =
+ "Output format for exported docs (${COMPLETION-CANDIDATES}),
defaulting to json.")
+ private Format formatOpt;
+
+ @picocli.CommandLine.Option(
+ names = "--compress",
+ description = "Compress the output. Defaults to false.")
+ private boolean compressOpt;
+
+ @picocli.CommandLine.Option(
+ names = "--limit",
Review Comment:
Made `--limit` a `long`, so `abc` is now a usage error. If the small fix was
something else, tell me which.
--
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]