PHP Class GetOptionKit\OptionParser

ファイルを表示 Open project: c9s/getoptionkit Class Usage Examples

Public Properties

Property Type Description
$longOptions
$shortOptions
$specs

Public Methods

Method Description
__construct ( OptionCollection $specs )
parse ( array $argv ) : OptionResult | Option[]
setSpecs ( OptionCollection $specs )

Protected Methods

Method Description
consumeOptionToken ( Option $spec, $arg, $next, &$success = false ) : boolean consume option value from current argument or from the next argument
preprocessingArguments ( array $argv ) preprocess the argv array
pushOptionValue ( Option $spec, $arg, $next ) * push value to multipl value option

Method Details

__construct() public method

public __construct ( OptionCollection $specs )
$specs OptionCollection

consumeOptionToken() protected method

consume option value from current argument or from the next argument
protected consumeOptionToken ( Option $spec, $arg, $next, &$success = false ) : boolean
$spec Option
return boolean next token consumed?

parse() public method

public parse ( array $argv ) : OptionResult | Option[]
$argv array
return OptionResult | Option[]

preprocessingArguments() protected method

- split option and option value - separate arguments after "--"
protected preprocessingArguments ( array $argv )
$argv array

pushOptionValue() protected method

* push value to multipl value option
protected pushOptionValue ( Option $spec, $arg, $next )
$spec Option

setSpecs() public method

public setSpecs ( OptionCollection $specs )
$specs OptionCollection

Property Details

$longOptions public_oe property

public $longOptions

$shortOptions public_oe property

public $shortOptions

$specs public_oe property

public $specs