// }}}
- // {{{ getHelp()
+ // {{{ getCommands()
- function getHelp($command)
+ /**
+ * Return a list of all the commands defined by this class.
+ * @return array list of commands
+ * @access public
+ */
+ function getCommands()
+ {
+ $ret = array();
+ foreach (array_keys($this->commands) as $command) {
+ $ret[$command] = $this->commands[$command]['summary'];
+ }
+ return $ret;
+ }
+
+ // }}}
+ // {{{ getOptions()
+
+ function getOptions($command)
{
- return array(null, 'No help avaible yet');
+ return @$this->commands[$command]['options'];
}
// }}}
}
}
+ // }}}
+ // {{{ getHelp()
+
+ function getHelp($command)
+ {
+ $help = preg_replace('/{config\s+([^\}]+)}/e', "\$config->get('\1')", @$this->commands[$command]['doc']);
+ return $help;
+ }
+
// }}}
// {{{ run()