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
public abstract class AbstractPrintedCommandUsageGenerator extends AbstractCommandUsageGenerator
Abstract command usage generator for generators that use aUsagePrinter
to generate the documentation
-
-
Field Summary
Fields Modifier and Type Field Description private int
columnSize
-
Fields inherited from class com.github.rvesse.airline.help.common.AbstractUsageGenerator
DEFAULT_COLUMNS
-
-
Constructor Summary
Constructors Constructor Description AbstractPrintedCommandUsageGenerator(int columns, java.util.Comparator<? super OptionMetadata> optionComparator, boolean includeHidden)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected UsagePrinter
createUsagePrinter(java.io.OutputStream out)
Creates a usage printer for the given streamabstract <T> void
usage(java.lang.String programName, java.lang.String[] groupNames, java.lang.String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, UsagePrinter out)
Generate the help and output it using the providedUsagePrinter
<T> void
usage(java.lang.String programName, java.lang.String[] groupNames, java.lang.String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, java.io.OutputStream out)
Generate the help and output it to the stream-
Methods 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
-
-
-
-
Constructor Detail
-
AbstractPrintedCommandUsageGenerator
public AbstractPrintedCommandUsageGenerator(int columns, java.util.Comparator<? super OptionMetadata> optionComparator, boolean includeHidden)
-
-
Method Detail
-
usage
public abstract <T> void usage(java.lang.String programName, java.lang.String[] groupNames, java.lang.String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, UsagePrinter out) throws java.io.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:
java.io.IOException
- Thrown if there is a problem generating usage output
-
createUsagePrinter
protected UsagePrinter createUsagePrinter(java.io.OutputStream out)
Creates a usage printer for the given stream- Parameters:
out
- Output stream- Returns:
- Usage Printer
-
usage
public <T> void usage(java.lang.String programName, java.lang.String[] groupNames, java.lang.String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, java.io.OutputStream out) throws java.io.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:
java.io.IOException
- Thrown if there is a problem generating usage output
-
-