Skip to content

Option Default Value

Yo-An Lin edited this page Apr 23, 2015 · 1 revision

To define a default value of an option, you can use the defaultValue accessor:

$specs->add('o|output?', 'option with optional value.' )
    ->isa('File')
    ->defaultValue('output.txt')
    ;

Once you defined the default value, the options with default value will be set to the default value before the parser parse everything from the command line.

Clone this wiki locally