MCPcopy Create free account
hub / github.com/apache/solr / printToolHelp

Method printToolHelp

solr/core/src/java/org/apache/solr/cli/SolrCLI.java:296–312  ·  view source on GitHub ↗

Prints tool help for a given tool

(Tool tool)

Source from the content-addressed store, hash-verified

294 }
295
296 /** Prints tool help for a given tool */
297 public static void printToolHelp(Tool tool) throws IOException {
298 HelpFormatter formatter = getFormatter();
299 Options nonDeprecatedOptions = new Options();
300
301 tool.getOptions().getOptions().stream()
302 .filter(option -> !option.isDeprecated())
303 .forEach(nonDeprecatedOptions::addOption);
304
305 String usageString = tool.getUsage() == null ? "bin/solr " + tool.getName() : tool.getUsage();
306 boolean autoGenerateUsage = tool.getUsage() == null;
307 formatter.printHelp(
308 usageString,
309 "\n" + tool.getHeader(),
310 nonDeprecatedOptions,
311 tool.getFooter(),
312 autoGenerateUsage);
313 }
314
315 @SuppressForbidden(reason = "System.out for formatting")

Callers 1

Calls 10

getFormatterMethod · 0.95
printHelpMethod · 0.80
getOptionsMethod · 0.65
getUsageMethod · 0.65
getNameMethod · 0.65
getHeaderMethod · 0.65
getFooterMethod · 0.65
forEachMethod · 0.45
filterMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected