Move OptionParser initialization out of try block.

This allows exceptions that result from creating the optionparser to
display to the developer, making debugging easier.

Fixes #3157
This commit is contained in:
mark_story 2012-08-27 22:07:28 -04:00
parent 7135ff29fb
commit fba17cffe9

View file

@ -361,8 +361,8 @@ class Shell extends Object {
array_shift($argv); array_shift($argv);
} }
$this->OptionParser = $this->getOptionParser();
try { try {
$this->OptionParser = $this->getOptionParser();
list($this->params, $this->args) = $this->OptionParser->parse($argv, $command); list($this->params, $this->args) = $this->OptionParser->parse($argv, $command);
} catch (ConsoleException $e) { } catch (ConsoleException $e) {
$this->out($this->OptionParser->help($command)); $this->out($this->OptionParser->help($command));