Interface CommandLine


  • public interface CommandLine
    Represents the parsed command line options.
    Since:
    1.0
    • Method Detail

      • getRemainingArgs

        java.util.List<java.lang.String> getRemainingArgs()
        Returns:
        The remaining arguments after the command name
      • getSystemProperties

        java.util.Properties getSystemProperties()
        Returns:
        The system properties specified
      • getOptions

        java.util.Map<Option,​java.lang.Object> getOptions()
        Returns:
        The declared option values
      • hasOption

        boolean hasOption​(java.lang.String name)
        Parameters:
        name - The name of the option
        Returns:
        Whether the given option is specified
      • optionValue

        java.lang.Object optionValue​(java.lang.String name)
        The value of an option.
        Parameters:
        name - The option
        Returns:
        The value
      • lastOption

        java.util.Map.Entry<java.lang.String,​java.lang.Object> lastOption()
        Returns:
        The last specified option
      • getRemainingArgsString

        java.lang.String getRemainingArgsString()
        Returns:
        The remaining args as one big string
      • getRemainingArgsWithOptionsString

        java.lang.String getRemainingArgsWithOptionsString()
        Returns:
        The remaining args as one big string without undeclared options
      • getUndeclaredOptions

        java.util.Map<java.lang.String,​java.lang.Object> getUndeclaredOptions()
        Returns:
        Any undeclared options
      • parseNew

        CommandLine parseNew​(java.lang.String[] args)
        Parses a new CommandLine instance that combines this instance with the given arguments.
        Parameters:
        args - The arguments
        Returns:
        A new CommandLine instance
      • getRawArguments

        java.lang.String[] getRawArguments()
        Returns:
        The raw unparsed arguments
      • build

        static CommandLine.Builder build()
        Build and parse a new command line.
        Returns:
        The builder
      • parse

        static CommandLine parse​(java.lang.String... args)
        Parse a new command line with the default options.
        Parameters:
        args - The arguments
        Returns:
        The command line