Improved context commands
This commit is contained in:
1 parent
01ee043bac
commit
ae17abb6c1
3 files changed
+69
-7
No files matched your search
+8
-5
@@ -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