Class ManGlobalUsageGenerator<T>
java.lang.Object
com.github.rvesse.airline.help.common.AbstractUsageGenerator
com.github.rvesse.airline.help.common.AbstractGlobalUsageGenerator<T>
com.github.rvesse.airline.help.man.ManGlobalUsageGenerator<T>
- All Implemented Interfaces:
GlobalUsageGenerator<T>
- Direct Known Subclasses:
ManMultiPageGlobalUsageGenerator
A global usage generator which generates Man pages in Troff format
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CommandUsageGeneratorprotected final ManUsageHelperprotected final intFields inherited from class AbstractUsageGenerator
DEFAULT_COLUMNS -
Constructor Summary
ConstructorsModifierConstructorDescriptionManGlobalUsageGenerator(int manSection) ManGlobalUsageGenerator(int manSection, boolean includeHidden) protectedManGlobalUsageGenerator(int manSection, boolean includeHidden, CommandUsageGenerator commandUsageGenerator) -
Method Summary
Modifier and TypeMethodDescriptionprotected ManUsageHelpercreateHelper(boolean includeHidden) protected StringgetCommandName(GlobalMetadata<T> global, String[] groupNames, CommandMetadata command) Gets the display name for a commandprotected voidoutputCommandList(TroffPrinter printer, GlobalMetadata<T> global) Outputs a documentation section that lists the available commandsprotected voidoutputCommandUsages(OutputStream output, TroffPrinter printer, GlobalMetadata<T> global) Outputs the command usages for all groupsprotected voidoutputDefaultGroupCommandUsages(OutputStream output, TroffPrinter printer, GlobalMetadata<T> global) Outputs the command usages for the commands in the default groupprotected voidoutputGroupCommandsList(TroffPrinter printer, GlobalMetadata<T> global, List<CommandGroupMetadata> groups) protected voidoutputGroupCommandUsages(OutputStream output, TroffPrinter printer, GlobalMetadata<T> global, List<CommandGroupMetadata> groups) Outputs the command usages for the commands in the given groupprotected voidoutputGroupList(TroffPrinter printer, GlobalMetadata<T> global) Outputs a documentation section that lists the available groups and the commands they containprotected voidoutputSynopsis(TroffPrinter printer, GlobalMetadata<T> global) Outputs a documentation section with a synopsis of how to use the CLIprotected voidoutputTitle(GlobalMetadata<T> global, TroffPrinter printer) Outputs the title section for the documentationprotected StringtoDescription(OptionMetadata option) Converts an option to its description formvoidusage(GlobalMetadata<T> global, OutputStream output) Generate the help and output it to the streamMethods inherited from class AbstractGlobalUsageGenerator
findHelpSections, sortCommandGroups, usageMethods inherited from class AbstractUsageGenerator
getCommandComparator, getOptionComparator, htmlize, includeHidden, sortArgumentsRestrictions, sortCommands, sortOptionRestrictions, sortOptions, toDefaultCommand, toDescription, toSynopsisUsage, toUsage, toUsage
-
Field Details
-
commandUsageGenerator
-
manSection
protected final int manSection -
helper
-
-
Constructor Details
-
ManGlobalUsageGenerator
public ManGlobalUsageGenerator() -
ManGlobalUsageGenerator
public ManGlobalUsageGenerator(int manSection) -
ManGlobalUsageGenerator
public ManGlobalUsageGenerator(int manSection, boolean includeHidden) -
ManGlobalUsageGenerator
protected ManGlobalUsageGenerator(int manSection, boolean includeHidden, CommandUsageGenerator commandUsageGenerator)
-
-
Method Details
-
createHelper
-
usage
Description copied from interface:GlobalUsageGeneratorGenerate the help and output it to the stream- Parameters:
global- Global metadataoutput- Stream to output to- Throws:
IOException- Thrown if there is a problem generating usage output
-
outputGroupList
Outputs a documentation section that lists the available groups and the commands they containUsed only when a CLI has command groups, if no groups are present then
outputCommandList(TroffPrinter, GlobalMetadata)is used instead.- Parameters:
printer- Troff printerglobal- Global meta-data- Throws:
IOException- Thrown if there is a problem generating usage output
-
outputGroupCommandsList
protected void outputGroupCommandsList(TroffPrinter printer, GlobalMetadata<T> global, List<CommandGroupMetadata> groups) throws IOException - Throws:
IOException
-
outputCommandList
Outputs a documentation section that lists the available commandsUsed only when a CLI does not have command groups, if groups are present then
outputGroupList(TroffPrinter, GlobalMetadata)is used instead.- Parameters:
printer- Troff Printerglobal- Global meta-data- Throws:
IOException- Thrown if there is a problem generating usage output
-
outputSynopsis
Outputs a documentation section with a synopsis of how to use the CLI- Parameters:
printer- Troff Printerglobal- Global meta-data- Throws:
IOException- Thrown if there is a problem generating usage output
-
outputTitle
Outputs the title section for the documentation- Parameters:
global- Global meta-dataprinter- Troff printer- Throws:
IOException- Thrown if there is a problem generating usage output
-
outputCommandUsages
protected void outputCommandUsages(OutputStream output, TroffPrinter printer, GlobalMetadata<T> global) throws IOException Outputs the command usages for all groups- Parameters:
output- Output streamprinter- Writerglobal- Global meta-data- Throws:
IOException- Thrown if there is a problem generating usage output
-
getCommandName
protected String getCommandName(GlobalMetadata<T> global, String[] groupNames, CommandMetadata command) Gets the display name for a command- Parameters:
global- Global meta-datagroupNames- Group name(s) (may be null)command- Command meta-data- Returns:
- Display name for the command
-
outputGroupCommandUsages
protected void outputGroupCommandUsages(OutputStream output, TroffPrinter printer, GlobalMetadata<T> global, List<CommandGroupMetadata> groups) throws IOException Outputs the command usages for the commands in the given group- Parameters:
output- Outputprinter- Writerglobal- Global Meta-datagroups- Groups Meta-data- Throws:
IOException- Thrown if there is a problem generating usage output
-
outputDefaultGroupCommandUsages
protected void outputDefaultGroupCommandUsages(OutputStream output, TroffPrinter printer, GlobalMetadata<T> global) throws IOException Outputs the command usages for the commands in the default group- Parameters:
output- Outputprinter- Writerglobal- Global meta-data- Throws:
IOException- Thrown if there is a problem generating usage output
-
toDescription
Converts an option to its description form- Overrides:
toDescriptionin classAbstractUsageGenerator
-