Skip to content

Commit

Permalink
Revert "fix empty value"
Browse files Browse the repository at this point in the history
This reverts commit 1bad81f.
  • Loading branch information
Leonardo Fuzeto committed Mar 7, 2018
1 parent 1bad81f commit 25be131
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Commando/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,9 @@ public function parse()
// the next token MUST be an "argument" and not another flag/option
$token = array_shift($tokens);
list($val, $type) = $this->_parseOption($token);

if ($type !== self::OPTION_TYPE_ARGUMENT && $option->getDefault() === null) {
throw new \Exception(sprintf('Unable to parse option %s: Expected an argument or default', $token));
}

$keyvals[$name] = ($type !== self::OPTION_TYPE_ARGUMENT)
? $option->getDefault()
: $val;
if ($type !== self::OPTION_TYPE_ARGUMENT)
throw new \Exception(sprintf('Unable to parse option %s: Expected an argument', $token));
$keyvals[$name] = $val;
}
}
}
Expand Down

0 comments on commit 25be131

Please sign in to comment.