By default, Zend_Console_Getopt uses
$_SERVER['argv'] for the array of command-line
arguments to parse. You can alternatively specify the array of
arguments as the second constructor argument. Finally, you
can append more arguments to those already used using the
addArguments() method, or you can replace the current
array of arguments using the setArguments() method.
In both cases, the parameter to these methods is a simple array of
strings. The former method appends the array to the current
arguments, and the latter method substitutes the array for the
current arguments.
Example 131. Using addArguments() and setArguments()
<?php
// By default, the constructor uses $_SERVER['argv']
$opts = new Zend_Console_Getopt('abp:');
// Append an array to the existing arguments
$opts->addArguments(array('-a', '-p', 'p_parameter', 'non_option_arg'));
// Substitute a new array for the existing arguments
$opts->setArguments(array('-a', '-p', 'p_parameter', 'non_option_arg'));




