Option

Models command line options. Options are values passed to a command line interface using -x or --x. Supported syntaxes depend on the parser.

Short name is generally used with a single dash, while long name requires a double-dash.

package

Default

Methods

Option constructor

__construct( $option = null) 

Arguments

$option

mixed | null

addChoice

addChoice( $choices) : $this

Arguments

$choices

string

Response

$this

getArgName

getArgName() : string

Response

string

getChoices

getChoices() : array

Response

array

getDefaultValue

getDefaultValue() : string

Response

string

getDescription

getDescription() : string

Response

string

getLongName

getLongName() : string

Response

string

getName

getName() : string

Response

string

getShortName

getShortName() : string

Response

string

isFlag

isFlag() : boolean

Response

boolean

isHelp

isHelp() : boolean

Response

boolean

isHidden

isHidden() : boolean

Response

boolean

isMultiValued

isMultiValued() : boolean

Response

boolean

isRequired

isRequired() : boolean

Response

boolean

isSingleValued

isSingleValued() : boolean

Response

boolean

setArgName

setArgName( $argName) : $this

Arguments

$argName

string

Response

$this

setChoices

setChoices( $choices) : $this

Arguments

$choices

string

Response

$this

setDefaultValue

setDefaultValue( $defaultValue) : $this

Arguments

$defaultValue

string

Response

$this

setDescription

setDescription( $description) : $this

Arguments

$description

string

Response

$this

setFlag

setFlag( $flag) : $this

Arguments

$flag

boolean

Response

$this

setHelp

setHelp( $help) : $this

Arguments

$help

boolean

Response

$this

setHidden

setHidden( $hidden) : $this

Arguments

$hidden

boolean

Response

$this

setLongName

setLongName( $longName) : $this

Arguments

$longName

string

Response

$this

setMultiValued

setMultiValued( $multiValued) : $this

Arguments

$multiValued

boolean

Response

$this

setRequired

setRequired( $required) : $this

Arguments

$required

boolean

Response

$this

setShortName

setShortName( $shortName) : $this

Arguments

$shortName

string

Response

$this

setSingleValued

setSingleValued( $singleValued) : $this

Arguments

$singleValued

boolean

Response

$this