Fixed issue with global commands in parent contexts

This commit is contained in:
2016-11-02 22:49:19 +01:00
parent 46806e3d62
commit 455574b6a5
3 changed files with 67 additions and 11 deletions

View File

@ -71,7 +71,7 @@ class Context
}, explode("\n", $docblock));
$info = [];
foreach ($lines as $line) {
if (preg_match("/^@(command|help|args) (.+?)$/", $line, $match)) {
if (preg_match("/^@(command|help|args|global)\\s*(.*)$/", $line, $match)) {
list($void,$key,$value) = $match;
$info[$key] = $value;
}
@ -132,6 +132,12 @@ class Context
return $ret;
}
public function isCommandGlobal($command)
{
$info = $this->commandInfo[$command];
return array_key_exists('global', $info);
}
public function getName()
{
return $this->name;