You can declare aliases for options using the setAliases()
method. The argument is an associative array, whose key is
a flag string declared previously, and whose value is a new
alias for that flag. These aliases are merged with any existing
aliases. In other words, aliases you declared earlier are
still in effect.
An alias may be declared only once. If you try to redefine
an alias, a Zend_Console_Getopt_Exception is thrown.
Example 130. Using setAliases()
<?php
$opts = new Zend_Console_Getopt('abp:');
$opts->setAliases(
array(
'a' => 'apple',
'a' => 'apfel',
'p' => 'pear'
)
);
In the example above, after declaring these aliases, -a, --apple and --apfel are aliases for each other. Also -p and --pear are aliases for each other.
The setAliases() method is the only way to define aliases
if you declared the options using the short syntax.




