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,10 +16,6 @@ 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:

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;