示例#1
0
 public function formatHelp($formatter = null)
 {
     if (is_null($formatter)) {
         return '';
     }
     $result = $formatter->formatHeading($this->_title);
     $formatter->indent();
     $result .= parent::formatHelp($formatter);
     $formatter->dedent();
     return $result;
 }
示例#2
0
 public function formatOptionHelp($formatter = null)
 {
     if (is_null($formatter)) {
         $formatter = $this->formatter;
     }
     $formatter->storeOptionStrings($this);
     $result = array();
     $result[] = $formatter->formatHeading(Horde_Argv_Translation::t("Options"));
     $formatter->indent();
     if ($this->optionList) {
         $result[] = parent::formatOptionHelp($formatter);
         $result[] = "\n";
     }
     foreach ($this->optionGroups as $group) {
         $result[] = $group->formatHelp($formatter);
         $result[] = "\n";
     }
     $formatter->dedent();
     // Drop the last "\n", or the header if no options or option groups:
     array_pop($result);
     return implode('', $result);
 }