private function getUsageHelp()
{
$commands = CommandLine\Commands::getInstance();
$out = "usage: %bphrozn%n %g<command>%n [options] [args]\n\n";
$out .= "Type 'phrozn help <command>' for help on a specific command.\n";
$out .= "Type 'phrozn ? help' for help on using help.\n";
$out .= "Type 'phrozn --version' to see the program version and installed plugins.\n";
$out .= "\nAvailable commands:\n";
$displayed = array(); // array of already displayed comands
foreach ($commands as $name => $data) {
if(isset($displayed[$name])) {
continue;
}
$command = $data['command'];
$out .= ' ' . $name;
if (null !== $command['aliases']) {
$out .= ' (' . implode(', ', $command['aliases']) . ')';
}
$out .= "\n";
$displayed[$name] = $name;
}
return $out;
}