Class AbstractPrintedCommandUsageGenerator

All Implemented Interfaces:
CommandUsageGenerator
Direct Known Subclasses:
CliCommandUsageGenerator, MarkdownCommandUsageGenerator

public abstract class AbstractPrintedCommandUsageGenerator extends AbstractCommandUsageGenerator
Abstract command usage generator for generators that use a UsagePrinter to generate the documentation
  • 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 provided UsagePrinter
      Type Parameters:
      T - Command type
      Parameters:
      programName - Program Name
      groupNames - Group Name(s)
      commandName - Command Name
      command - Command Metadata
      parserConfig - Parser configuration
      out - Usage printer to output with
      Throws:
      IOException - Thrown if there is a problem generating usage output
    • createUsagePrinter

      protected UsagePrinter createUsagePrinter(OutputStream out)
      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 Name
      groupNames - Group Name(s)
      commandName - Command Name
      command - Command Metadata
      parserConfig - Parser Configuration, if null is passed then the parser configuration is automatically determined based on the command class for which we are producing help
      out - Stream to output to
      Throws:
      IOException - Thrown if there is a problem generating usage output