From c7b1a637c24103c19bc5a9d7c0943aabb532804e Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Tue, 24 Jan 2017 21:13:20 +0100 Subject: [PATCH] Removed descr from command props --- CHANGELOG.md | 6 +----- examples/basic.php | 2 +- lib/Context.php | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 985cf36..d7b30a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,14 +16,10 @@ Major changes: * The event `Shell::EVT_BAD_COMMAND` will be fired if a command can not be found, assuming `Context->execute()` does not accept the command. (see *examples/commandevents.php*) - * When calling `Context->addCommand()` you can now use both `help` - and `descr` as the last argument to provide the description text - for the command. This change is intended to make `addCommand` and - the doccomment `@descr` more similar. New features: * Tasks can now be added and removed from the shell. Tasks will receive a call to their `update()` method once per main loop, until they are removed or return false from the `isValid()` method. Tasks need to - implement the `TaskInterface` interface. (see *examples/tasks.php*) \ No newline at end of file + implement the `TaskInterface` interface. (see *examples/tasks.php*) diff --git a/examples/basic.php b/examples/basic.php index 596a89f..ed6497e 100644 --- a/examples/basic.php +++ b/examples/basic.php @@ -30,7 +30,7 @@ $myShell->setPrompt("test>"); $ctx = $myShell->createContext("root"); $ctx->addCommand("hello", function () { echo "Hello World!\n"; -}, [ 'descr'=>'Say hello' ]); +}, [ 'help'=>'Say hello' ]); // Run the shell $myShell->run(); diff --git a/lib/Context.php b/lib/Context.php index 7f27e4f..c8f36e9 100644 --- a/lib/Context.php +++ b/lib/Context.php @@ -132,7 +132,6 @@ class Context $info = $this->commandInfo[$command]; $args = array_key_exists("args",$info)?$info['args']:""; $help = array_key_exists("help",$info)?$info['help']:""; - $help = $help?:(array_key_exists("descr",$info)?$info['descr']:""); $ret[trim("{$command} {$args}")] = $help; } return $ret;