/** * show documentation; use "pake help taskname" to see detailed documentation on task * * @param string $task * @param string $args * @throws pakeException * @author Alexey Zakhlestin */ public static function run_help($task, $args) { if (count($args) == 0) { self::get_instance()->help(); return; } $victim_name = $args[0]; $task_name = pakeTask::taskname_from_abbreviation($victim_name); $victim = null; foreach (pakeTask::get_tasks() as $name => $task) { if ($task_name == $name or $task_name == pakeTask::get_mini_task_name($name)) { $victim = $task; break; } } if (null === $victim) { throw new pakeException("Couldn't find documentation for {$task_name}"); } $title = 'Documentation for "' . $task_name . '" task'; pake_echo($title); pake_echo(str_repeat('=', mb_strlen($title))); pake_echo($victim->get_comment() . "\n"); pake_echo($victim->get_help()); }
public function display_prerequisites() { foreach (pakeTask::get_tasks() as $name => $task) { echo "pake " . pakeTask::get_mini_task_name($name) . "\n"; foreach ($task->get_prerequisites() as $prerequisite) { echo " {$prerequisite}\n"; } } }
/** * show documentation; use "pake help taskname" to see detailed documentation on task * * @param string $task * @param string $args * @return bool * @author Alexey Zakhlestin */ public static function run_help($task, $args) { if (count($args) == 0) { self::get_instance()->help(); return; } $victim_name = $args[0]; foreach (pakeTask::get_tasks() as $name => $task) { if ($victim_name == $name or $victim_name == pakeTask::get_mini_task_name($name)) { $victim = $task; break; } } $title = 'Documentation for "' . $victim_name . '" task'; pake_echo($title); pake_echo(str_repeat('=', mb_strlen($title))); pake_echo($victim->get_comment() . "\n"); pake_echo($victim->get_help()); }