Removed descr from command props

This commit is contained in:
Chris 2017-01-24 21:13:20 +01:00
parent 809c04abfa
commit c7b1a637c2
3 changed files with 2 additions and 7 deletions

View File

@ -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*)
implement the `TaskInterface` interface. (see *examples/tasks.php*)

View File

@ -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();

View File

@ -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;