Cli/ObjectCommand: add experimental flags

This commit is contained in:
Thomas Gelf 2016-03-17 01:12:16 +01:00
parent 5296616c41
commit ac245666a2
1 changed files with 23 additions and 0 deletions

View File

@ -13,6 +13,13 @@ class ObjectCommand extends Command
private $object;
private $experimental = array();
public function init()
{
$this->shiftExperimentalFlags();
}
/**
* Show a specific object
*
@ -292,4 +299,20 @@ class ObjectCommand extends Command
return $this->name;
}
protected function hasExperimental($flag)
{
return array_key_exists($flag, $this->experimentalFlags);
}
protected function shiftExperimentalFlags()
{
if ($flags = $this->params->shift('experimental')) {
foreach (preg_split('/,/', $flags) as $flag) {
$this->experimentalFlags[$flag] = true;
}
}
return $this;
}
}