Class CommandDescription.Builder

    • Method Detail

      • mainDescription

        public CommandDescription.Builder mainDescription​(java.util.List<org.jline.utils.AttributedString> mainDescription)
        Sets the main description.
        Parameters:
        mainDescription - the description lines
        Returns:
        this builder
      • option

        public CommandDescription.Builder option​(java.lang.String key,
                                                 java.util.List<org.jline.utils.AttributedString> description)
        Adds an option with its description.
        Parameters:
        key - the option syntax (e.g., "-l --long")
        description - the option description
        Returns:
        this builder
      • options

        public CommandDescription.Builder options​(java.util.Map<java.lang.String,​java.util.List<org.jline.utils.AttributedString>> options)
        Sets all options.
        Parameters:
        options - the options map
        Returns:
        this builder
      • valid

        public CommandDescription.Builder valid​(boolean valid)
        Sets whether this description is valid.
        Parameters:
        valid - true if valid
        Returns:
        this builder
      • command

        public CommandDescription.Builder command​(boolean command)
        Sets whether this description represents a command.
        Parameters:
        command - true if this is a command description
        Returns:
        this builder
      • subcommand

        public CommandDescription.Builder subcommand​(boolean subcommand)
        Sets whether this description represents a subcommand.
        Parameters:
        subcommand - true if this is a subcommand
        Returns:
        this builder
      • highlighted

        public CommandDescription.Builder highlighted​(boolean highlighted)
        Sets whether the command should be highlighted.
        Parameters:
        highlighted - true if highlighted
        Returns:
        this builder
      • errorPattern

        public CommandDescription.Builder errorPattern​(java.util.regex.Pattern errorPattern)
        Sets the error pattern.
        Parameters:
        errorPattern - the error pattern
        Returns:
        this builder
      • errorIndex

        public CommandDescription.Builder errorIndex​(int errorIndex)
        Sets the error index.
        Parameters:
        errorIndex - the error index
        Returns:
        this builder
      • build

        public CommandDescription build()
        Builds the command description.
        Returns:
        the immutable command description