public function parse($argv, $override = true)
{
$exists = [];
$override ? $this->_values = $this->_defaults : ($exists = array_fill_keys(array_keys($this->_values), true));
foreach ($argv as $arg) {
if ($arg === '--') {
break;
}
if ($arg[0] === '-') {
list($name, $value) = $this->_parse(ltrim($arg, '-'));
if ($override || !isset($exists[$name])) {
$this->add($name, $value, $override);
}
}
}
return $this->get();
}