Class AbstractPrintedCommandUsageGenerator

    • Field Detail

      • columnSize

        private final int columnSize
    • 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 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:
        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 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:
        java.io.IOException - Thrown if there is a problem generating usage output