Package software.amazon.smithy.cli
Class HelpPrinter
- java.lang.Object
- 
- software.amazon.smithy.cli.HelpPrinter
 
- 
 public final class HelpPrinter extends java.lang.ObjectGenerates and prints structured help output.
- 
- 
Constructor SummaryConstructors Constructor Description HelpPrinter(java.lang.String name)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HelpPrinterdocumentation(java.lang.String documentation)Defines the optional long-form documentation that comes after long argument descriptions.static HelpPrinterfromArguments(java.lang.String name, Arguments arguments)Create a HelpPrinter that registers help options and parameters defined in the givenarguments.HelpPrintermaxWidth(int maxWidth)HelpPrinteroption(java.lang.String longName, java.lang.String shortName, java.lang.String description)Adds an option that takes no argument value.HelpPrinterparam(java.lang.String longName, java.lang.String shortName, java.lang.String exampleValue, java.lang.String description)Adds a parameter that requires an argument value.HelpPrinterpositional(java.lang.String name, java.lang.String description)Defines a positional argument.voidprint(ColorFormatter colors, CliPrinter printer)Prints the generated help to the given printer.HelpPrintersummary(java.lang.String summary)Defines the summary text of the command that comes after the short argument description and before the long argument descriptions.
 
- 
- 
- 
Method Detail- 
maxWidthpublic HelpPrinter maxWidth(int maxWidth) 
 - 
fromArgumentspublic static HelpPrinter fromArguments(java.lang.String name, Arguments arguments) Create a HelpPrinter that registers help options and parameters defined in the givenarguments.- Parameters:
- name- Name of the command.
- arguments- Arguments to extract params from.
- Returns:
- Returns the created HelpPrinter.
 
 - 
summarypublic HelpPrinter summary(java.lang.String summary) Defines the summary text of the command that comes after the short argument description and before the long argument descriptions.- Parameters:
- summary- Summary text to display.
- Returns:
- Returns the printer.
 
 - 
documentationpublic HelpPrinter documentation(java.lang.String documentation) Defines the optional long-form documentation that comes after long argument descriptions.- Parameters:
- documentation- Documentation to display.
- Returns:
- Returns the printer.
 
 - 
optionpublic HelpPrinter option(java.lang.String longName, java.lang.String shortName, java.lang.String description) Adds an option that takes no argument value.- Parameters:
- longName- Nullable argument long form (e.g., "--foo").
- shortName- Nullable argument short form (e.g., null).
- description- Description description of the argument.
- Returns:
- Returns the printer.
 
 - 
parampublic HelpPrinter param(java.lang.String longName, java.lang.String shortName, java.lang.String exampleValue, java.lang.String description) Adds a parameter that requires an argument value.- Parameters:
- longName- Nullable argument long form (e.g., "--foo").
- shortName- Nullable argument short form (e.g., null).
- exampleValue- Example value of the parameter (e.g., "FOO").
- description- Description description of the argument.
- Returns:
- Returns the printer.
 
 - 
positionalpublic HelpPrinter positional(java.lang.String name, java.lang.String description) Defines a positional argument.- Parameters:
- name- Name of the positional argument (e.g.,- <MODEL...>)
- description- Description of the argument.
- Returns:
- Returns the printer.
 
 - 
printpublic void print(ColorFormatter colors, CliPrinter printer) Prints the generated help to the given printer.- Parameters:
- colors- Color formatter.
- printer- CliPrinter to write to.
 
 
- 
 
-