public abstract class AbstractCommandUsageGenerator extends AbstractUsageGenerator implements CommandUsageGenerator
DEFAULT_COLUMNS| Constructor and Description |
|---|
AbstractCommandUsageGenerator() |
AbstractCommandUsageGenerator(boolean includeHidden) |
AbstractCommandUsageGenerator(Comparator<? super HelpHint> hintComparator,
Comparator<? super OptionMetadata> optionComparator,
Comparator<? super Map.Entry<Integer,String>> exitCodeComparator,
boolean includeHidden) |
AbstractCommandUsageGenerator(Comparator<? super OptionMetadata> optionComparator) |
AbstractCommandUsageGenerator(Comparator<? super OptionMetadata> optionComparator,
boolean includeHidden) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
findHelpSections(CommandMetadata command,
List<HelpSection> preSections,
List<HelpSection> postSections)
Finds the help sections
|
protected List<Map.Entry<Integer,String>> |
sortExitCodes(List<Map.Entry<Integer,String>> exitCodes)
Sorts the exit codes assuming a non-null comparator was provided at
instantiation time
|
<T> void |
usage(CommandMetadata command,
ParserMetadata<T> parserConfig,
OutputStream output)
Generates the help output to the provided output stream
|
<T> void |
usage(String programName,
String[] groupNames,
String commandName,
CommandMetadata command,
ParserMetadata<T> parserConfig)
Generate the help and output it on standard out
|
getCommandComparator, getOptionComparator, htmlize, includeHidden, sortArgumentsRestrictions, sortCommands, sortOptionRestrictions, sortOptions, toDefaultCommand, toDescription, toDescription, toSynopsisUsage, toUsage, toUsageclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitusagepublic AbstractCommandUsageGenerator()
public AbstractCommandUsageGenerator(boolean includeHidden)
public AbstractCommandUsageGenerator(Comparator<? super OptionMetadata> optionComparator)
public AbstractCommandUsageGenerator(Comparator<? super OptionMetadata> optionComparator, boolean includeHidden)
public AbstractCommandUsageGenerator(Comparator<? super HelpHint> hintComparator, Comparator<? super OptionMetadata> optionComparator, Comparator<? super Map.Entry<Integer,String>> exitCodeComparator, boolean includeHidden)
public <T> void usage(CommandMetadata command, ParserMetadata<T> parserConfig, OutputStream output) throws IOException
CommandUsageGeneratorusage in interface CommandUsageGeneratorcommand - Command MetadataparserConfig - Parser configurationoutput - Output StreamIOExceptionpublic <T> void usage(String programName, String[] groupNames, String commandName, CommandMetadata command, ParserMetadata<T> parserConfig) throws IOException
CommandUsageGeneratorusage in interface CommandUsageGeneratorT - Command typeprogramName - Program NamegroupNames - Group Name(s)commandName - Command Namecommand - Command MetadataparserConfig - Parser configuration, if null is passed then the
parser configuration is automatically determined based on the
command class for which we are producing helpIOException - Thrown if there is a problem generating usage outputprotected List<Map.Entry<Integer,String>> sortExitCodes(List<Map.Entry<Integer,String>> exitCodes)
exitCodes - Exit codesprotected void findHelpSections(CommandMetadata command, List<HelpSection> preSections, List<HelpSection> postSections)
command - Command meta-datapreSections - Sections that should be placed before base contentpostSections - Sections that should be placed after base contentCopyright © 2012–2022. All rights reserved.