From 08ab24d6653b25992fdcdb2c6c2c4bed90be4a24 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Mon, 30 Jan 2017 12:10:23 +0100 Subject: [PATCH] Bugfixes to help command --- lib/Shell.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Shell.php b/lib/Shell.php index 2814736..66baa87 100644 --- a/lib/Shell.php +++ b/lib/Shell.php @@ -429,11 +429,14 @@ class Shell $_($command, $args,$info); } if (count($ghelp)) { - printf("\e[1mCommands from parent contexts:\e[0m\n"); - if (strpos($command," ")!==false) { - list($command,$args) = explode(" ",$command,2); - } else $args=null; - $_($command, $args,$info); + foreach ($ghelp as $command=>$info) { + printf("\e[1mCommands from parent contexts:\e[0m\n"); + if (strpos($command," ")!==false) { + list($command,$args) = explode(" ",$command,2); + } else $args=null; + if (!array_key_exists($command,$ghelp)) continue; + $_($command, $args,$info); + } } printf("\e[1mGlobal commands:\e[0m\n"); $_("exit", null, "Leave the shell");