Module com.github.rvesse.airline
Class AbstractPrintedCommandUsageGenerator
java.lang.Object
com.github.rvesse.airline.help.common.AbstractUsageGenerator
com.github.rvesse.airline.help.common.AbstractCommandUsageGenerator
com.github.rvesse.airline.help.common.AbstractPrintedCommandUsageGenerator
- All Implemented Interfaces:
CommandUsageGenerator
- Direct Known Subclasses:
CliCommandUsageGenerator
,MarkdownCommandUsageGenerator
Abstract command usage generator for generators that use a
UsagePrinter
to generate the documentation-
Field Summary
FieldsFields inherited from class com.github.rvesse.airline.help.common.AbstractUsageGenerator
DEFAULT_COLUMNS
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractPrintedCommandUsageGenerator
(int columns, Comparator<? super OptionMetadata> optionComparator, boolean includeHidden) -
Method Summary
Modifier and TypeMethodDescriptionprotected UsagePrinter
Creates a usage printer for the given streamabstract <T> void
usage
(String programName, String[] groupNames, String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, UsagePrinter out) Generate the help and output it using the providedUsagePrinter
<T> void
usage
(String programName, String[] groupNames, String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, OutputStream out) Generate the help and output it to the streamMethods inherited from class com.github.rvesse.airline.help.common.AbstractCommandUsageGenerator
findHelpSections, sortExitCodes, usage, usage
Methods inherited from class com.github.rvesse.airline.help.common.AbstractUsageGenerator
getCommandComparator, getOptionComparator, htmlize, includeHidden, sortArgumentsRestrictions, sortCommands, sortOptionRestrictions, sortOptions, toDefaultCommand, toDescription, toDescription, toSynopsisUsage, toUsage, toUsage
-
Field Details
-
columnSize
private final int columnSize
-
-
Constructor Details
-
AbstractPrintedCommandUsageGenerator
public AbstractPrintedCommandUsageGenerator(int columns, Comparator<? super OptionMetadata> optionComparator, boolean includeHidden)
-
-
Method Details
-
usage
public abstract <T> void usage(String programName, String[] groupNames, String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, UsagePrinter out) throws IOException Generate the help and output it using the providedUsagePrinter
- Type Parameters:
T
- Command type- Parameters:
programName
- Program NamegroupNames
- Group Name(s)commandName
- Command Namecommand
- Command MetadataparserConfig
- Parser configurationout
- Usage printer to output with- Throws:
IOException
- Thrown if there is a problem generating usage output
-
createUsagePrinter
Creates a usage printer for the given stream- Parameters:
out
- Output stream- Returns:
- Usage Printer
-
usage
public <T> void usage(String programName, String[] groupNames, String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, OutputStream out) throws IOException Description copied from interface:CommandUsageGenerator
Generate the help and output it to the stream- Type Parameters:
T
- Command type- Parameters:
programName
- Program NamegroupNames
- Group Name(s)commandName
- Command Namecommand
- Command MetadataparserConfig
- Parser Configuration, ifnull
is passed then the parser configuration is automatically determined based on the command class for which we are producing helpout
- Stream to output to- Throws:
IOException
- Thrown if there is a problem generating usage output
-