public function __construct($name, adapter $adapter = null)
{
$this->name = (string) $name;
$this->setCli()->setAdapter($adapter)->setLocale()->setPrompt()->setArgumentsParser()->setOutputWriter()->setInfoWriter()->setErrorWriter()->setWarningWriter()->setHelpWriter();
if ($this->adapter->php_sapi_name() !== 'cli') {
throw new exceptions\logic('\'' . $this->getName() . '\' must be used in CLI only');
}
}