Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
08ab24d665 | |||
fdd1814875 |
@ -113,8 +113,8 @@ class Shell
|
|||||||
}
|
}
|
||||||
$context->setShell($this);
|
$context->setShell($this);
|
||||||
$this->context = $context;
|
$this->context = $context;
|
||||||
$context->onEnter();
|
|
||||||
$this->dispatchEvent(self::EVT_CONTEXT_CHANGED);
|
$this->dispatchEvent(self::EVT_CONTEXT_CHANGED);
|
||||||
|
$context->onEnter();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -429,12 +429,15 @@ class Shell
|
|||||||
$_($command, $args,$info);
|
$_($command, $args,$info);
|
||||||
}
|
}
|
||||||
if (count($ghelp)) {
|
if (count($ghelp)) {
|
||||||
|
foreach ($ghelp as $command=>$info) {
|
||||||
printf("\e[1mCommands from parent contexts:\e[0m\n");
|
printf("\e[1mCommands from parent contexts:\e[0m\n");
|
||||||
if (strpos($command," ")!==false) {
|
if (strpos($command," ")!==false) {
|
||||||
list($command,$args) = explode(" ",$command,2);
|
list($command,$args) = explode(" ",$command,2);
|
||||||
} else $args=null;
|
} else $args=null;
|
||||||
|
if (!array_key_exists($command,$ghelp)) continue;
|
||||||
$_($command, $args,$info);
|
$_($command, $args,$info);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
printf("\e[1mGlobal commands:\e[0m\n");
|
printf("\e[1mGlobal commands:\e[0m\n");
|
||||||
$_("exit", null, "Leave the shell");
|
$_("exit", null, "Leave the shell");
|
||||||
$_(".", null, "Show the context tree");
|
$_(".", null, "Show the context tree");
|
||||||
|
Reference in New Issue
Block a user