Improved context commands
This commit is contained in:
@ -210,11 +210,14 @@ class Shell
|
||||
$this->popContext();
|
||||
break;
|
||||
case 'help':
|
||||
echo
|
||||
"Built in commands:\n".
|
||||
" . Show current context\n".
|
||||
" .. Go to parent context\n".
|
||||
" exit Exit the shell\n";
|
||||
$help = $this->context->getCommandHelp();
|
||||
printf("Commands in current context:\n\n");
|
||||
foreach ($help as $command=>$info) {
|
||||
printf(" %-20s %s\n", $command, $info);
|
||||
}
|
||||
printf("\nGlobal commands:\n\n");
|
||||
printf(" %-20s %s\n", "exit", "Leave the shell");
|
||||
printf(" %-20s %s\n", "..", "Discard the current context and go to parent");
|
||||
break;
|
||||
case 'exit':
|
||||
$this->stop();
|
||||
|
Reference in New Issue
Block a user