Copilot commented on code in PR #4739: URL: https://github.com/apache/solr/pull/4739#discussion_r3835708517
########## solr/solr-ref-guide/modules/deployment-guide/pages/cli/solr-package.adoc: ########## @@ -0,0 +1,130 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// DO NOT EDIT -- this page is auto-generated from picocli annotations. +// To update: modify the @Command/@Option annotations in the Java source, then run: +// ./gradlew :solr:solr-ref-guide:generateCliDocs + += bin/solr package +:page-toclevels: 2 + +// tag::picocli-generated-man-section-name[] +== Name + +bin/solr package - Install, deploy and manage Solr packages in SolrCloud. + +// end::picocli-generated-man-section-name[] + +// tag::picocli-generated-man-section-synopsis[] +== Synopsis + +.... +bin/solr package [-vy] [--cluster] [--update] [-c=COLLECTION] + [--collections=COLLECTIONS] [-u=<credentials>] [--param=PARAMS]... + [-s=<solrConnection> | --solr-url=<solrUrl> | -z=<zkHost>] COMMAND + [ARGS...] +.... + +// end::picocli-generated-man-section-synopsis[] + +// tag::picocli-generated-man-section-description[] +== Description + +Install, deploy and manage Solr packages in SolrCloud. + +// end::picocli-generated-man-section-description[] + +// tag::picocli-generated-man-section-options[] +== Options + +*-c*, *--collection*=_COLLECTION_:: + The collection to apply the package to. + +*--cluster*:: + Specifies that this action should affect cluster-level plugins only. + +*--collections*=_COLLECTIONS_:: + Specifies that this action should affect plugins for the given collections only, excluding cluster level plugins. + +*--param*=_PARAMS_:: + List of parameters to be used with the deploy command. + +*-s*, *--solr-connection*=_<solrConnection>_:: + Zookeeper or HTTP(s) connection string; unnecessary if SOLR_CONNECTION is defined in solr.in.sh; otherwise, defaults to localhost:9983. + +*--solr-url*=_<solrUrl>_:: + Base Solr URL, which can be used to determine the zk-host if that's not known. + +*-u*, *--credentials*=_<credentials>_:: + Credentials in the format username:password. Example: --credentials solr:SolrRocks + +*--update*:: + If a deployment is an update over a previous deployment. + +*-v*, *--verbose*:: + Enable verbose mode. + +*-y*, *--no-prompt*:: + Don't prompt for input; accept all default choices, defaults to false. + +*-z*, *--zk-host*=_<zkHost>_:: + Zookeeper connection string; unnecessary if ZK_HOST is defined in solr.in.sh; otherwise, defaults to localhost:9983. + +// end::picocli-generated-man-section-options[] + +// tag::picocli-generated-man-section-arguments[] +== Arguments + +_COMMAND_:: + Package command: add-repo, add-key, list-installed, list-available, list-deployed, install, deploy, undeploy, uninstall. + +[_ARGS_...]:: + Command-specific arguments (package name[:version], repository name/URL, key file, etc.). + +// end::picocli-generated-man-section-arguments[] + +// tag::picocli-generated-man-section-commands[] +// end::picocli-generated-man-section-commands[] + +// tag::picocli-generated-man-section-exit-status[] +== Exit Codes: + +*0*:: + Operation completed successfully. + +*1*:: + Operation failed; check output for details. + +// end::picocli-generated-man-section-exit-status[] + +// tag::picocli-generated-man-section-footer[] +== Examples: + +[%hardbreaks] + # Add a package repository + bin/solr package add-repo myrepo https://my.repo.example/bin/solr packages Review Comment: The generated example URL is invalid: the source annotation contains `https://my.repo.example/solr-packages`, but the doc generator's broad command-name replacement rewrites the `solr-package` substring inside that URL to `bin/solr package`. Restrict the generator replacement to standalone command names and regenerate this page. ########## 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 --- Review Comment: The migrated command has no usage-help option, so `bin/solr package --help` is parsed as an unknown option (and the required `COMMAND` remains unsatisfied) instead of displaying help. Add the repository's `HelpMixin`, which is the preferred subcommand pattern. This issue also appears on line 164 of the same file. -- 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]
