Path

ez components / documentation / api reference / 2007.2 / consoletools


ConsoleTools: ezcConsoleArgument

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcConsoleArgument

The ezcConsoleArgument class represents an argument on the console. [source]
This class is the container to store information about an argument submitted to a shell application. It is used to define the appearance of an argument before parsing the parameter string and contains the received value afterwards. Argument objects are stored in an instance of the set class ezcConsoleArguments which is stored in {ezcConsoleInput::$argumentDefinition}.

Properties

mixed read/write  $default
A default value, if not mandatory.
string read/write  $longhelp
A long help text-
bool read/write  $mandatory
Whether the argument is mandatory.
bool read/write  $multiple
Whether the argument accepts multiple values.
string read/write  $name
The name for the argument. Must be unique.
string read/write  $shorthelp
A short help text.
int read/write  $type
The value type.
mixed read  $value
The value parsed from the parameter string, using ezcConsoleInput::process().

Member Variables

protected array $properties = array(
"name" => null,
"type" => ezcConsoleInput::TYPE_STRING,
"shorthelp" => "No help available.",
"longhelp" => "There is no help for this argument available.",
"mandatory" => true,
"multiple" => false,
"default" => null,
"value" => null,
)

Properties

Method Summary

public void __construct( [$name = null], [$type = ezcConsoleInput::TYPE_STRING], [$shorthelp = "No help available."], [$longhelp = "There is no help for this argument available."], [$mandatory = true], [$multiple = false], [$default = null] )
Creates a new console argument object.

Methods

__construct

void __construct( [string $name = null], [int $type = ezcConsoleInput::TYPE_STRING], [string $shorthelp = "No help available."], [string $longhelp = "There is no help for this argument available."], [bool $mandatory = true], [bool $multiple = false], [mixed $default = null] )
Creates a new console argument object.
Creates a new console argument object, which represents a single argument on the shell. Arguments are stored insiede ezcConsoleArguments which is used with ezcConsoleInput.
For the type property see ezcConsoleInput::TYPE_STRING and ezcConsoleInput::TYPE_INT. If 1 argument is defined as optional ($mandatory = false), all following arguments are autolamtically considered optional, too.

Parameters

Name Type Description
$name string The name for the argument. Must be unique.
$type int The value type.
$shorthelp string A short help text.
$longhelp string A long help text-
$mandatory bool Whether the argument is mandatory.
$multiple bool Whether the argument accepts multiple values.
$default mixed A default value, if not mandatory.

Last updated: Mon, 17 Dec 2007