janhoy opened a new pull request, #3247:
URL: https://github.com/apache/solr/pull/3247

   This is not intended for merge, more to spark a discussion about replacing 
commons-cli with [picocli](https://picocli.info) in bin/solr.
   
   This PR does the following
   * Parses `bin/solr` with picocli by default but also retain commons-cli for 
comparison. Switch using `SOLR_PICOCLI=false`
   * Implements `VersionTool`, `HealthcheckTool` and `StatusTool` as sub 
commands
   * New `ZkTool` sub command, which in turn has `ZkLsTool` as a sub command
   * Demonstrate use of custom `defaultValueProvider` to let `--zk-host` option 
look for a value in environment
   
   Implementing this took 2-3 hours. The annotation approach removes the need 
to lots of boilerplate, and the framework is fairly flexible. It should be 
doable to cover the rest of the tools within a few days. Following this 
approach we can validate old vs new output in the same codebase, and then 
remove commons-cli once everything is up to date.
   
   Remaining research to do option inheritance in a proper way, tailor the 
output formatting as we wish, implementing option groups for mutual exclusive 
and opts etc, and extend `defaultValueProvider` to handle default values for 
more options.
   
   Sample output for `bin/solr -h`:
   
   ```
   Usage: solr [-hv] [COMMAND]
   Global options:
     -h, --help      Display this help message
     -v, --version   Print version information and exit
   
   Commands:
     status       Get the status of a Solr server.
     healthcheck  Check the health of a SolrCloud collection.
     version      Prints the Solr version.
     zk           Sub commands for working with ZooKeeper.
   
   SolrCloud example (embedded Zookeeper):
   
     ./solr start -c
   
   For more help on how to use Solr, head to https://solr.apache.org/
   ```


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