Include missing commands in package tool help section (#1975)

* feat(package/tool): include uninstall command usage in help

* feat(package/tool): include add-key usage in help

* feat(package/tool): display options for package tool
This commit is contained in:
S N Munendra 2020-10-14 22:11:54 +05:30 committed by GitHub
parent a7a6757aff
commit b43c389386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -16,9 +16,6 @@
*/
package org.apache.solr.util;
import static org.apache.solr.packagemanager.PackageUtils.printGreen;
import static org.apache.solr.packagemanager.PackageUtils.print;
import java.io.File;
import java.lang.invoke.MethodHandles;
import java.nio.file.Paths;
@ -46,6 +43,9 @@ import org.apache.solr.util.SolrCLI.StatusTool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.solr.packagemanager.PackageUtils.print;
import static org.apache.solr.packagemanager.PackageUtils.printGreen;
public class PackageTool extends SolrCLI.ToolBase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@ -192,6 +192,9 @@ public class PackageTool extends SolrCLI.ToolBase {
printGreen("./solr package add-repo <repository-name> <repository-url>");
print("Add a repository to Solr.");
print("");
printGreen("./solr package add-key <file-containing-trusted-key>");
print("Add a trusted key to Solr.");
print("");
printGreen("./solr package install <package-name>[:<version>] ");
print("Install a package into Solr. This copies over the artifacts from the repository into Solr's internal package store and sets up classloader for this package to be used.");
print("");
@ -212,6 +215,9 @@ public class PackageTool extends SolrCLI.ToolBase {
print("");
printGreen("./solr package undeploy <package-name> -collections <comma-separated-collections>");
print("Undeploys a package from specified collection(s)");
print("");
printGreen("./solr package uninstall <package-name>:<version>");
print("Uninstall an unused package with specified version from Solr. Both package name and version are required.");
print("\n");
print("Note: (a) Please add '-solrUrl http://host:port' parameter if needed (usually on Windows).");
print(" (b) Please make sure that all Solr nodes are started with '-Denable.packages=true' parameter.");

View File

@ -427,6 +427,7 @@ public class SolrCLI implements CLIO {
formatter.printHelp("mv", getToolOptions(new ZkMvTool()));
formatter.printHelp("ls", getToolOptions(new ZkLsTool()));
formatter.printHelp("export", getToolOptions(new ExportTool()));
formatter.printHelp("package", getToolOptions(new PackageTool()));
List<Class<Tool>> toolClasses = findToolClassesInPackage("org.apache.solr.util");
for (Class<Tool> next : toolClasses) {