From 01ee043baced6db024eb091f3adcfd2df39d6541 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Tue, 1 Nov 2016 15:45:54 +0100 Subject: [PATCH] The . builtin command now shows the stack too --- lib/Shell.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Shell.php b/lib/Shell.php index 86c7e4a..a744f7b 100644 --- a/lib/Shell.php +++ b/lib/Shell.php @@ -199,8 +199,11 @@ class Shell { switch ($command) { case '.': - printf("context<%s>:\n", $this->context->getName()); - echo " ".join("\n ",explode("\n",json_encode($this->context->getData(),JSON_PRETTY_PRINT)))."\n"; + printf("context<%s>: %s\n", $this->context->getName(), json_encode($this->context->getData())); + $level = 0; + foreach ($this->contextStack as $context) { + printf(" %s- context<%s>\n", str_repeat(" ",$level++), $context->getName()); + } break; case '..': if (count($this->contextStack)>0)