Skip to content

Commit

Permalink
add a command to run all options
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed May 1, 2011
1 parent 14f78f8 commit a050653
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Cake/Console/Command/UpgradeShell.php
Expand Up @@ -20,6 +20,18 @@ function startup() {
$this->out('<warning>Dry-run mode enabled!</warning>', 1, Shell::QUIET);
}
}

function all() {
foreach($this->OptionParser->subcommands() as $command) {
$name = $command->name();
if ($name === 'all') {
continue;
}
$this->out('Running ' . $name);
$this->$name();
}
}

/**
* Update helpers.
*
Expand Down Expand Up @@ -317,6 +329,10 @@ function getOptionParser() {
return parent::getOptionParser()
->description("A shell to help automate upgrading from CakePHP 1.3 to 2.0. \n" .
"Be sure to have a backup of your application before running these commands.")
->addSubcommand('all', array(
'help' => 'Run all upgrade commands.',
'parser' => $subcommandParser
))
->addSubcommand('i18n', array(
'help' => 'Update the i18n translation method calls.',
'parser' => $subcommandParser
Expand Down

0 comments on commit a050653

Please sign in to comment.