Skip to content

Commit

Permalink
Adding subcommand docs for i18n shell.
Browse files Browse the repository at this point in the history
Adding execute checks to shell, this is a temporary fix that stops extra clears being done.
  • Loading branch information
markstory committed Oct 14, 2010
1 parent fe7c7a1 commit 3be24d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cake/console/libs/i18n.php
Expand Up @@ -109,7 +109,9 @@ public function initdb() {
*/
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')));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cake/console/libs/shell.php
Expand Up @@ -320,14 +320,14 @@ public function runCommand($command, $argv) {
$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) {
Expand Down

0 comments on commit 3be24d0

Please sign in to comment.