Interface CommandLine

  • All Known Implementing Classes:
    DefaultCommandLine

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

      • getEnvironment

        java.lang.String getEnvironment()
        Returns:
        The environment specified
      • isEnvironmentSet

        boolean isEnvironmentSet()
        Returns:
        Whether the environment is user specified
      • getCommandName

        java.lang.String getCommandName()
        Returns:
        The command name specified
      • getRemainingArgs

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

        java.lang.String[] getRemainingArgsArray()
        Returns:
        The remaining arguments as an array
      • getSystemProperties

        java.util.Properties getSystemProperties()
        Returns:
        The system properties specified
      • 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
      • getRemainingArgsLineSeparated

        java.lang.String getRemainingArgsLineSeparated()
        Returns:
        The remaining args separated by the line separator char
      • getUndeclaredOptions

        java.util.Map<java.lang.String,​java.lang.Object> getUndeclaredOptions()
      • lookupEnvironmentForCommand

        java.lang.String lookupEnvironmentForCommand()
      • setCommand

        void setCommand​(java.lang.String scriptName)
      • 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()