Module com.github.rvesse.airline
Class CliCommandUsageGenerator
java.lang.Object
com.github.rvesse.airline.help.common.AbstractUsageGenerator
com.github.rvesse.airline.help.common.AbstractCommandUsageGenerator
com.github.rvesse.airline.help.common.AbstractPrintedCommandUsageGenerator
com.github.rvesse.airline.help.cli.CliCommandUsageGenerator
- All Implemented Interfaces:
CommandUsageGenerator
-
Field Summary
FieldsFields inherited from class com.github.rvesse.airline.help.common.AbstractUsageGenerator
DEFAULT_COLUMNS
-
Constructor Summary
ConstructorsConstructorDescriptionCliCommandUsageGenerator
(boolean includeHidden) CliCommandUsageGenerator
(int columns) CliCommandUsageGenerator
(int columns, boolean includeHidden) CliCommandUsageGenerator
(int columns, Comparator<? super OptionMetadata> optionComparator, boolean includeHidden) -
Method Summary
Modifier and TypeMethodDescriptionprotected CliUsageHelper
createHelper
(Comparator<? super OptionMetadata> optionComparator, boolean includeHidden) protected void
outputDescription
(UsagePrinter out, String programName, String[] groupNames, String commandName, CommandMetadata command) Outputs a documentation section describing the commandprotected <T> void
outputOptionsAndArguments
(UsagePrinter out, CommandMetadata command, List<OptionMetadata> options, ArgumentsMetadata arguments, ParserMetadata<T> parserConfig) Outputs a documentation section detailing options and their usagesprotected List
<OptionMetadata> outputSynopsis
(UsagePrinter out, String programName, String[] groupNames, String commandName, CommandMetadata command) Outputs a documentation section with a synopsis of command usage<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
Methods inherited from class com.github.rvesse.airline.help.common.AbstractPrintedCommandUsageGenerator
createUsagePrinter, usage
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
-
Field Details
-
helper
-
-
Constructor Details
-
CliCommandUsageGenerator
public CliCommandUsageGenerator() -
CliCommandUsageGenerator
public CliCommandUsageGenerator(boolean includeHidden) -
CliCommandUsageGenerator
public CliCommandUsageGenerator(int columns) -
CliCommandUsageGenerator
public CliCommandUsageGenerator(int columns, boolean includeHidden) -
CliCommandUsageGenerator
public CliCommandUsageGenerator(int columns, Comparator<? super OptionMetadata> optionComparator, boolean includeHidden)
-
-
Method Details
-
createHelper
protected CliUsageHelper createHelper(Comparator<? super OptionMetadata> optionComparator, boolean includeHidden) -
usage
public <T> void usage(String programName, String[] groupNames, String commandName, CommandMetadata command, ParserMetadata<T> parserConfig, UsagePrinter out) throws IOException Description copied from class:AbstractPrintedCommandUsageGenerator
Generate the help and output it using the providedUsagePrinter
- Specified by:
usage
in classAbstractPrintedCommandUsageGenerator
- 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
-
outputOptionsAndArguments
protected <T> void outputOptionsAndArguments(UsagePrinter out, CommandMetadata command, List<OptionMetadata> options, ArgumentsMetadata arguments, ParserMetadata<T> parserConfig) throws IOException Outputs a documentation section detailing options and their usages- Type Parameters:
T
- Command type- Parameters:
out
- Usage printercommand
- Command meta-dataoptions
- Options meta-dataarguments
- Arguments meta-dataparserConfig
- Parser configuration- Throws:
IOException
- Thrown if there is a problem generating usage output
-
outputSynopsis
protected List<OptionMetadata> outputSynopsis(UsagePrinter out, String programName, String[] groupNames, String commandName, CommandMetadata command) throws IOException Outputs a documentation section with a synopsis of command usage- Parameters:
out
- Usage printerprogramName
- Program namegroupNames
- Group name(s)commandName
- Command namecommand
- Command meta-data- Returns:
- Collection of all options (Global, Group and Command)
- Throws:
IOException
- Thrown if there is a problem generating usage output
-
outputDescription
protected void outputDescription(UsagePrinter out, String programName, String[] groupNames, String commandName, CommandMetadata command) throws IOException Outputs a documentation section describing the command- Parameters:
out
- Usage printerprogramName
- Program namegroupNames
- Group name(s)commandName
- Command namecommand
- Command meta-data- Throws:
IOException
- Thrown if there is a problem generating usage output
-