In addition to specifying the help strings when declaring option
rules in the long format, you can associate help strings
with option rules using the setHelp()
method. The argument to the setHelp() method is an
associative array, in which the key is a flag, and the value is a
corresponding help string.
Example 129. Using setHelp()
<?php
$opts = new Zend_Console_Getopt('abp:');
$opts->setHelp(
array(
'a' => 'apple option, with no parameter',
'b' => 'banana option, with required integer parameter',
'p' => 'pear option, with optional string parameter'
)
);
If you declared options with aliases, you can use any of the aliases as the key of the associative array.
The setHelp() method is the only way to define help
strings if you declared the options using the short syntax.




