Cli/ObjectCommand: add experimental flags
This commit is contained in:
parent
5296616c41
commit
ac245666a2
|
@ -13,6 +13,13 @@ class ObjectCommand extends Command
|
||||||
|
|
||||||
private $object;
|
private $object;
|
||||||
|
|
||||||
|
private $experimental = array();
|
||||||
|
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->shiftExperimentalFlags();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a specific object
|
* Show a specific object
|
||||||
*
|
*
|
||||||
|
@ -292,4 +299,20 @@ class ObjectCommand extends Command
|
||||||
|
|
||||||
return $this->name;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue