Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcConsoleArgument

ConsoleTools::ezcConsoleArgument

Class ezcConsoleArgument

The ezcConsoleArgument class represents an argument on the console.

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}.

Source for this file: /ConsoleTools/src/input/argument.php

Version:   //autogen//

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.
Documentation generated by phpDocumentor 1.4.3