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

oops: Fix incorrect cli argument requirement

parent 193a1c69
No related branches found
No related tags found
No related merge requests found
...@@ -205,8 +205,11 @@ class Module { ...@@ -205,8 +205,11 @@ class Module {
$this->parseArgs(array_slice($argv, 1)); $this->parseArgs(array_slice($argv, 1));
foreach (array_keys($this->arguments) as $idx=>$name) foreach (array_keys($this->arguments) as $idx=>$name)
if (!isset($this->_args[$idx])) if (!isset($this->_args[$idx])) {
$this->optionError($name . " is a required argument"); $info = $this->arguments[$name];
if (!is_array($info) || !isset($info['required']) || $info['required'])
$this->optionError($name . " is a required argument");
}
elseif (is_array($this->arguments[$name]) elseif (is_array($this->arguments[$name])
&& isset($this->arguments[$name]['options']) && isset($this->arguments[$name]['options'])
&& !isset($this->arguments[$name]['options'][$this->_args[$idx]])) && !isset($this->arguments[$name]['options'][$this->_args[$idx]]))
......
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