public function execute(array $args, array $options = array()) { if (empty($args)) { $formater = new TextFormater(array('quote' => ' * ')); $this->writeln('Available commands:', Colors::BLACK | Colors::BOLD); foreach ($this->console->getCommands() as $name => $fqdn) { if ($fqdn !== __CLASS__) { $this->writeln($formater->format($name)); } } $scriptName = basename($_SERVER['SCRIPT_FILENAME']); $this->writeln("Use './{$scriptName} help command' for more info"); } else { $commandFQDN = $this->console->getCommand($args[0]); $help = Help::fromFQDN($commandFQDN, Utils::get($args, 1)); $this->writeln($help); } }
/** * Returns the text formated with the specified options * * @param string $text * @param array $options * @return string */ public static function apply($text, array $options = array()) { $formater = new TextFormater($options); return $formater->format($text); }