public function formatUsage($usage) { return sprintf(Horde_Argv_Translation::t("Usage:") . " %s\n", $usage); }
public function formatUsage($usage) { return sprintf("%s %s\n", $this->formatHeading(Horde_Argv_Translation::t("Usage")), $usage); }
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); }
public function checkChoice($opt, $value) { if (in_array($value, $this->choices)) { return $value; } else { $choices = array(); foreach ($this->choices as $choice) { $choices[] = (string) $choice; } $choices = "'" . implode("', '", $choices) . "'"; throw new Horde_Argv_OptionValueException(sprintf(Horde_Argv_Translation::t("option %s: invalid choice: '%s' (choose from %s)"), $opt, $value, $choices)); } }