Interface CommandLine.Builder<T extends CommandLine.Builder>

  • Type Parameters:
    T - The concrete type of the builder
    Enclosing interface:
    CommandLine

    public static interface CommandLine.Builder<T extends CommandLine.Builder>
    A build for constructing a command line parser.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T addOption​(java.lang.String name, java.lang.String description)
      Add an option.
      CommandLine parse​(java.lang.String... args)
      Parses the given list of command line arguments.
      CommandLine parseString​(java.lang.String string)
      Parses a string of all the command line options converting them into an array of arguments to pass to #parse(String..args).
    • Method Detail

      • addOption

        T addOption​(java.lang.String name,
                    java.lang.String description)
        Add an option.
        Parameters:
        name - The name
        description - The description
        Returns:
        This builder
      • parseString

        CommandLine parseString​(java.lang.String string)
        Parses a string of all the command line options converting them into an array of arguments to pass to #parse(String..args).
        Parameters:
        string - The string
        Returns:
        The command line
      • parse

        CommandLine parse​(java.lang.String... args)
        Parses the given list of command line arguments. Arguments starting with -D become system properties, arguments starting with -- or - become either declared or undeclared options. All other arguments are put into a list of remaining arguments
        Parameters:
        args - The arguments
        Returns:
        The command line state