Represents a command line option.
Method Summary
-
Boolean
acceptParameter()
Returns true if the option accept a parameter.
-
mixed
getDefault()
Returns the default value.
-
string
getHelp()
Returns the help text.
-
string
getName()
Returns the name.
-
string
getShortcut()
Returns the shortcut.
-
Boolean
isArray()
Returns true if the option can take multiple values.
-
Boolean
isParameterOptional()
Returns true if the option takes an optional parameter.
-
Boolean
isParameterRequired()
Returns true if the option requires a parameter.
-
setDefault($default)
Sets the default value.
-
__construct($name, $shortcut, $mode, $help, $default)
Constructor.
Method Details
-
(Boolean) acceptParameter ()
Browse code
Returns true if the option accept a parameter.
returns true if parameter mode is not self::PARAMETER_NONE, false otherwise
-
Returns the default value.
returns The default value
-
Returns the help text.
returns The help text
-
Returns the name.
returns The name
-
(string) getShortcut ()
Browse code
Returns the shortcut.
returns The shortcut
-
Returns true if the option can take multiple values.
returns true if mode is self::IS_ARRAY, false otherwise
-
(Boolean) isParameterOptional ()
Browse code
Returns true if the option takes an optional parameter.
returns true if parameter mode is self::PARAMETER_OPTIONAL, false otherwise
-
(Boolean) isParameterRequired ()
Browse code
Returns true if the option requires a parameter.
returns true if parameter mode is self::PARAMETER_REQUIRED, false otherwise
-
| $default |
The default value |
Sets the default value.
-
__construct ($name, $shortcut, $mode, $help, $default)
Browse code
| $name |
The option name |
| $shortcut |
The shortcut (can be null) |
| $mode |
The option mode: self::PARAMETER_REQUIRED, self::PARAMETER_NONE or self::PARAMETER_OPTIONAL |
| $help |
A help text |
| $default |
The default value (must be null for self::PARAMETER_REQUIRED or self::PARAMETER_NONE) |
Constructor.
|