Console_CommandLine
[ class tree: Console_CommandLine ] [ index: Console_CommandLine ] [ all elements ]

Class: Console_CommandLine_Argument

Source Location: /Console_CommandLine-1.2.0/Console/CommandLine/Argument.php

Class Overview

Console_CommandLine_Element
   |
   --Console_CommandLine_Argument

Class that represent a command line argument.


Author(s):

Version:

  • Release: 1.2.0

Copyright:

  • 2007 David JEAN LOUIS

Variables

Methods


Inherited Variables

Inherited Methods

Class: Console_CommandLine_Element

Console_CommandLine_Element::__construct()
Constructor.
Console_CommandLine_Element::toString()
Returns the string representation of the element.
Console_CommandLine_Element::validate()
Validates the element instance and set it's default values.

Class Details

[line 42]
Class that represent a command line argument.


[ Top ]


Class Variables

$choices = array()

[line 69]

An array of possible values for the argument.
  • Var: Valid choices for the argument
  • Access: public

Type:   array


[ Top ]

$multiple =  false

[line 52]

Setting this to true will tell the parser that the argument expects more than one argument and that argument values should be stored in an array.
  • Var: Whether the argument expects multiple values
  • Access: public

Type:   boolean


[ Top ]

$optional =  false

[line 62]

Setting this to true will tell the parser that the argument is optional and can be ommited.

Note that it is not a good practice to make arguments optional, it is the role of the options to be optional, by essence.

  • Var: Whether the argument is optional or not.
  • Access: public

Type:   boolean


[ Top ]



Method Detail

validate   [line 81]

void validate( )

Validates the argument instance.
  • Todo: use exceptions
  • Throws: Console_CommandLine_Exception
  • Access: public

Overrides Console_CommandLine_Element::validate() (Validates the element instance and set it's default values.)
[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:51:31 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.