Class ManGlobalUsageGenerator<T>

    • Constructor Detail

      • 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 Detail

      • createHelper

        protected ManUsageHelper createHelper​(boolean includeHidden)
      • usage

        public void usage​(GlobalMetadata<T> global,
                          java.io.OutputStream output)
                   throws java.io.IOException
        Description copied from interface: GlobalUsageGenerator
        Generate the help and output it to the stream
        Parameters:
        global - Global metadata
        output - Stream to output to
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output
      • outputGroupList

        protected void outputGroupList​(TroffPrinter printer,
                                       GlobalMetadata<T> global)
                                throws java.io.IOException
        Outputs a documentation section that lists the available groups and the commands they contain

        Used only when a CLI has command groups, if no groups are present then outputCommandList(TroffPrinter, GlobalMetadata) is used instead.

        Parameters:
        printer - Troff printer
        global - Global meta-data
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output
      • outputCommandList

        protected void outputCommandList​(TroffPrinter printer,
                                         GlobalMetadata<T> global)
                                  throws java.io.IOException
        Outputs a documentation section that lists the available commands

        Used only when a CLI does not have command groups, if groups are present then outputGroupList(TroffPrinter, GlobalMetadata) is used instead.

        Parameters:
        printer - Troff Printer
        global - Global meta-data
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output
      • outputSynopsis

        protected void outputSynopsis​(TroffPrinter printer,
                                      GlobalMetadata<T> global)
                               throws java.io.IOException
        Outputs a documentation section with a synopsis of how to use the CLI
        Parameters:
        printer - Troff Printer
        global - Global meta-data
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output
      • outputTitle

        protected void outputTitle​(GlobalMetadata<T> global,
                                   TroffPrinter printer)
                            throws java.io.IOException
        Outputs the title section for the documentation
        Parameters:
        global - Global meta-data
        printer - Troff printer
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output
      • outputCommandUsages

        protected void outputCommandUsages​(java.io.OutputStream output,
                                           TroffPrinter printer,
                                           GlobalMetadata<T> global)
                                    throws java.io.IOException
        Outputs the command usages for all groups
        Parameters:
        output - Output stream
        printer - Writer
        global - Global meta-data
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output
      • getCommandName

        protected java.lang.String getCommandName​(GlobalMetadata<T> global,
                                                  java.lang.String[] groupNames,
                                                  CommandMetadata command)
        Gets the display name for a command
        Parameters:
        global - Global meta-data
        groupNames - Group name(s) (may be null)
        command - Command meta-data
        Returns:
        Display name for the command
      • outputGroupCommandUsages

        protected void outputGroupCommandUsages​(java.io.OutputStream output,
                                                TroffPrinter printer,
                                                GlobalMetadata<T> global,
                                                java.util.List<CommandGroupMetadata> groups)
                                         throws java.io.IOException
        Outputs the command usages for the commands in the given group
        Parameters:
        output - Output
        printer - Writer
        global - Global Meta-data
        groups - Groups Meta-data
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output
      • outputDefaultGroupCommandUsages

        protected void outputDefaultGroupCommandUsages​(java.io.OutputStream output,
                                                       TroffPrinter printer,
                                                       GlobalMetadata<T> global)
                                                throws java.io.IOException
        Outputs the command usages for the commands in the default group
        Parameters:
        output - Output
        printer - Writer
        global - Global meta-data
        Throws:
        java.io.IOException - Thrown if there is a problem generating usage output