Browse Source

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
mark_story 13 years ago
parent
commit
fba17cffe9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Console/Shell.php

+ 1 - 1
lib/Cake/Console/Shell.php

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