Repository navigation
SOLR-18513: Port ExportTool to picocli - #5040
Merged
Merged
Conversation
Adds the picocli code path next to the commons-cli one, with tests that run the tool under both parsers and the generated reference page.
picocli now lists and validates json, jsonl and javabin itself, so the help and the reference page show the choices and an unknown format is a usage error. The commons-cli path is unchanged.
janhoy
approved these changes
Oct 7, 2026
picocli now rejects a non-numeric --limit before the tool runs, with a usage error, instead of failing later in the number parsing. The commons-cli path is unchanged, and -1 still means all documents.
janhoy
reviewed
Oct 7, 2026
No picocli feature has been released yet, so a new command is a detail of the SOLR-17697 entry. Its author and JIRA are added there instead of a separate entry.
…export # Conflicts: # changelog/unreleased/SOLR-17697-picocli-experimental-cli.yml # solr/core/src/java/org/apache/solr/cli/SolrCLI.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-18513
Description
Adds the picocli code path for
bin/solr export, next to the commons-cli one.Solution
ExportToolgets its annotated options andcallTool()and is registered inSolrCLI; the commons-cli path is unchanged. As before, a connection target (--solr-url,--solr-connectionor--zk-host) is mandatory; a missing one exits with picocli's usage-error code 2 instead of 1. Written with Claude Code.Tests
ExportToolTestexports tojsonland checks the file for the default and explicit--limit,--query,--fieldsand--format, and the missing-target failure;ExportToolPicocliTestruns it through picocli.check -x testis clean (rat skipped).Checklist
mainbranch../gradlew check.