Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ff9845e23e | |||
e5b328b822 |
@ -407,19 +407,27 @@ class Shell
|
||||
}
|
||||
}
|
||||
ksort($ghelp);
|
||||
printf("Commands in current context:\n");
|
||||
$_ = function($command,$args,$info) {
|
||||
printf(" \e[97m%s\e[0m \e[90;3m%s\e[0m - \e[36m%s\e[0m\n", $command, $args, $info);
|
||||
};
|
||||
printf("\e[1mCommands:\e[0m\n");
|
||||
foreach ($help as $command=>$info) {
|
||||
printf(" %-20s %s\n", $command, $info);
|
||||
if (strpos($command," ")!==false) {
|
||||
list($command,$args) = explode(" ",$command,2);
|
||||
} else $args=null;
|
||||
$_($command, $args,$info);
|
||||
}
|
||||
if (count($ghelp)) {
|
||||
printf("\nImported from parent contexts:\n");
|
||||
foreach ($ghelp as $command=>$info) {
|
||||
printf(" %-20s %s\n", $command, $info);
|
||||
}
|
||||
printf("\n\e[0mCommands from parent contexts:\e[0m\n");
|
||||
if (strpos($command," ")!==false) {
|
||||
list($command,$args) = explode(" ",$command,2);
|
||||
} else $args=null;
|
||||
$_($command, $args,$info);
|
||||
}
|
||||
printf("\nGlobal commands:\n");
|
||||
printf(" %-20s %s\n", "exit", "Leave the shell");
|
||||
printf(" %-20s %s\n", "..", "Discard the current context and go to parent");
|
||||
$_("exit", null, "Leave the shell");
|
||||
$_(".", null, "Show the context tree");
|
||||
$_("..", null, "Discard the current context and go to parent");
|
||||
break;
|
||||
case 'exit':
|
||||
$this->stop();
|
||||
|
Reference in New Issue
Block a user