Skip to content
Snippets Groups Projects
Commit 92690474 authored by Jared Hancock's avatar Jared Hancock
Browse files

Add defaults to parsed command-line options

parent 0ae7435f
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,8 @@ class Module {
$this->parseOptions();
if (isset($this->_options[$name]))
return $this->_options[$name];
elseif ($this->options[$name]->default)
return $this->options[$name]->default;
else
return $default;
}
......@@ -167,6 +169,10 @@ class Module {
else
$this->_args[$name] = &$this->_args[$idx];
foreach ($this->options as $name=>$opt)
if (!isset($this->_options[$name]))
$this->_options[$name] = $opt->default;
if ($this->autohelp && $this->getOption('help')) {
$this->showHelp();
die();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment