Reverting change for console help, and improving it so it returns help for the command intended to be run

This commit is contained in:
Jose Lorenzo Rodriguez 2011-04-22 16:46:32 -04:30
parent 63fd35b384
commit 1d384ec68f
2 changed files with 24 additions and 25 deletions

View file

@ -333,10 +333,14 @@ class Shell extends Object {
array_shift($argv);
}
try {
$this->OptionParser = $this->getOptionParser();
list($this->params, $this->args) = $this->OptionParser->parse($argv, $command);
$this->command = $command;
} catch (ConsoleException $e) {
return $this->out($this->OptionParser->help($command));
}
$this->command = $command;
if (!empty($this->params['help'])) {
return $this->_displayHelp($command);
}

View file

@ -171,7 +171,6 @@ class ShellDispatcher {
$command = $this->args[0];
}
try {
if ($Shell instanceof Shell) {
$Shell->initialize();
$Shell->loadTasks();
@ -192,10 +191,6 @@ class ShellDispatcher {
return $Shell->main();
}
}
} catch(ConsoleException $e) {
$this->help();
$this->_stop(1);
}
throw new MissingShellMethodException(array('shell' => $shell, 'method' => $arg));
}