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

    Modifier and Type
    Method
    Description
    addOption(String name, String description)
    Add an option.
    parse(String... args)
    Parses the given list of command line arguments.
    Parses a string of all the command line options converting them into an array of arguments to pass to #parse(String..args).
  • Method Details

    • addOption

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

      CommandLine parseString(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(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