org.codehaus.groovy.grails.cli.parsing
Class DefaultCommandLine
java.lang.Object
org.codehaus.groovy.grails.cli.parsing.DefaultCommandLine
- All Implemented Interfaces:
- CommandLine
public class DefaultCommandLine
- extends java.lang.Object
- implements CommandLine
Implementation of the CommandLine interface.
- Since:
- 2.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultCommandLine
public DefaultCommandLine()
addDeclaredOption
public void addDeclaredOption(java.lang.String name,
Option option)
addUndeclaredOption
public void addUndeclaredOption(java.lang.String option)
addUndeclaredOption
public void addUndeclaredOption(java.lang.String option,
java.lang.Object value)
addDeclaredOption
public void addDeclaredOption(java.lang.String name,
Option option,
java.lang.Object value)
setEnvironment
public void setEnvironment(java.lang.String environment)
setCommand
public void setCommand(java.lang.String name)
- Specified by:
setCommand in interface CommandLine
getEnvironment
public java.lang.String getEnvironment()
- Specified by:
getEnvironment in interface CommandLine
- Returns:
- The environment specified
lookupEnvironmentForCommand
public java.lang.String lookupEnvironmentForCommand()
- Specified by:
lookupEnvironmentForCommand in interface CommandLine
isEnvironmentSet
public boolean isEnvironmentSet()
- Specified by:
isEnvironmentSet in interface CommandLine
- Returns:
- Whether the environment is user specified
setCommandName
public void setCommandName(java.lang.String cmd)
getCommandName
public java.lang.String getCommandName()
- Specified by:
getCommandName in interface CommandLine
- Returns:
- The command name specified
addRemainingArg
public void addRemainingArg(java.lang.String arg)
getRemainingArgs
public java.util.List<java.lang.String> getRemainingArgs()
- Specified by:
getRemainingArgs in interface CommandLine
- Returns:
- The remaining arguments after the command name
getRemainingArgsArray
public java.lang.String[] getRemainingArgsArray()
- Specified by:
getRemainingArgsArray in interface CommandLine
- Returns:
- The remaining arguments as an array
getSystemProperties
public java.util.Properties getSystemProperties()
- Specified by:
getSystemProperties in interface CommandLine
- Returns:
- The system properties specified
hasOption
public boolean hasOption(java.lang.String name)
- Specified by:
hasOption in interface CommandLine
- Parameters:
name - The name of the option
- Returns:
- Whether the given option is specified
optionValue
public java.lang.Object optionValue(java.lang.String name)
- Description copied from interface:
CommandLine
- The value of an option
- Specified by:
optionValue in interface CommandLine
- Parameters:
name - The option
- Returns:
- The value
getRemainingArgsString
public java.lang.String getRemainingArgsString()
- Specified by:
getRemainingArgsString in interface CommandLine
- Returns:
- The remaining args as one big string
getRemainingArgsLineSeparated
public java.lang.String getRemainingArgsLineSeparated()
- Specified by:
getRemainingArgsLineSeparated in interface CommandLine
- Returns:
- The remaining args separated by the line separator char
getUndeclaredOptions
public java.util.Map<java.lang.String,java.lang.Object> getUndeclaredOptions()
- Specified by:
getUndeclaredOptions in interface CommandLine
addSystemProperty
public void addSystemProperty(java.lang.String name,
java.lang.String value)