Adding subcommand docs for i18n shell.

Adding execute checks to shell, this is a temporary fix that stops extra clears being done.
This commit is contained in:
mark_story 2010-10-10 01:32:20 -04:00
parent fe7c7a1b12
commit 3be24d0b0b
2 changed files with 5 additions and 3 deletions

View file

@ -109,7 +109,9 @@ class I18nShell extends Shell {
*/
protected function _getOptionParser() {
$parser = parent::_getOptionParser();
return $parser->description(__('I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.'));
return $parser->description(__('I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.'))
->addSubcommand('initdb', array('help' => __('Initialize the i18n table.')))
->addSubcommand('extract', array('help' => __('Extract the po translations from your application')));
}
/**

View file

@ -320,14 +320,14 @@ class Shell extends Object {
$isMethod = $this->hasMethod($command);
$isMain = $this->hasMethod('main');
if ($isTask || $isMethod) {
if ($isTask || $isMethod && $command !== 'execute') {
array_shift($argv);
}
$this->OptionParser = $this->_getOptionParser();
list($this->params, $this->args) = $this->OptionParser->parse($argv);
if ($isTask || $isMethod || $isMain) {
if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) {
$this->startup();
}
if ($isTask) {