You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/07/30 14:36:00 UTC

[jira] [Commented] (SOLR-17697) Use picocli instead of commons-cli

    [ https://issues.apache.org/jira/browse/SOLR-17697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100472#comment-18100472 ] 

ASF subversion and git services commented on SOLR-17697:
--------------------------------------------------------

Commit 6f680d32aec4f11e808b18a8b57485c4772a46e7 in solr's branch refs/heads/jira/SOLR-17697-picocli from Jan Høydahl
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=6f680d32aec ]

SOLR-17697: Bring picocli path to parity with main's --solr-connection changes

- SolrCLI --version now prints 'Client version:' matching commons-cli output
- ZkConnectionOptions, ConnectionOptions (create/delete) and StatusTool gain
  -s/--solr-connection accepting a ZooKeeper or HTTP(s) connection string,
  with --solr-url now long-only, mirroring CommonCLIOptions on main
- StatusTool picocli target options grouped mutually exclusive like the
  commons-cli OptionGroup; zk/connection targets resolved to a Solr URL via
  new shared CLIUtils.solrUrlFromConnection (extracted from normalizeSolrUrl)
- CliDefaultValueProvider supports SOLR_CONNECTION env default
- test_status.bats accepts both engines' mutual-exclusion error messages

Connection parsing is string-only; network calls happen only at tool
execution time, never during picocli parsing.


> Use picocli instead of commons-cli
> ----------------------------------
>
>                 Key: SOLR-17697
>                 URL: https://issues.apache.org/jira/browse/SOLR-17697
>             Project: Solr
>          Issue Type: Improvement
>          Components: cli
>            Reporter: Jan Høydahl
>            Assignee: Jan Høydahl
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 9h
>  Remaining Estimate: 0h
>
> Apache commons-cli has served us well for years, but our CLI has out-grown its capabilities, with multiple sub commands and a plethora of options and arguments. We have much custom code to work around limitations.
> By embracing [Picocli|https://picocli.info/], an annotation based cli framework, it will be easier to maintain the cli and add further tools. We propose to target 10.1 and do work gradually in a feature branch.
> The feature branch is {{{}jira/SOLR-17697-picocli{}}}, you can view it in a [draft PR not intended for merge|https://github.com/apache/solr/pull/3254]. That PR has a description on how to contribute, and a checklist of tools not yet converted. Once all tools are converted, all tests are green and all docs updated, we can merge this work.
> There is an env var {{SOLR_PICOCLI=true}} that we currently use to swtich from old commons-cli and new picocli. Once the feature branch is merged we can choose to make SOLR_PICOCLI default to true but retain the old commons-cli parser code for a few releases, so there will be a workaround for potential bugs. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org