Fixed issue with global commands in parent contexts
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user