From 2fca41c35d6e8dc89137ad622dc183f103069d2a Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Wed, 29 May 2013 13:41:57 +0000 Subject: [PATCH 1/4] Enable the user to provide a CLI theme through the --theme option for all bake tasks --- lib/Cake/Console/Command/BakeShell.php | 2 ++ lib/Cake/Console/Command/Task/ControllerTask.php | 2 ++ lib/Cake/Console/Command/Task/FixtureTask.php | 2 ++ lib/Cake/Console/Command/Task/ModelTask.php | 2 ++ lib/Cake/Console/Command/Task/ProjectTask.php | 2 ++ lib/Cake/Console/Command/Task/TestTask.php | 2 ++ lib/Cake/Console/Command/Task/ViewTask.php | 2 ++ 7 files changed, 14 insertions(+) diff --git a/lib/Cake/Console/Command/BakeShell.php b/lib/Cake/Console/Command/BakeShell.php index 9f3118dec..880800c9c 100644 --- a/lib/Cake/Console/Command/BakeShell.php +++ b/lib/Cake/Console/Command/BakeShell.php @@ -243,6 +243,8 @@ class BakeShell extends AppShell { 'help' => __d('cake_console', 'Database connection to use in conjunction with `bake all`.'), 'short' => 'c', 'default' => 'default' + ))->addOption('theme', array( + 'help' => __d('cake_console', 'Theme to use when baking code.') )); } diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php index 48a1ea1da..5b2057af2 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -474,6 +474,8 @@ class ControllerTask extends BakeTask { ))->addOption('connection', array( 'short' => 'c', 'help' => __d('cake_console', 'The connection the controller\'s model is on.') + ))->addOption('theme', array( + 'help' => __d('cake_console', 'Theme to use when baking code`.') ))->addSubcommand('all', array( 'help' => __d('cake_console', 'Bake all controllers with CRUD methods.') ))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.')); diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php index 085474eed..0d425d35b 100644 --- a/lib/Cake/Console/Command/Task/FixtureTask.php +++ b/lib/Cake/Console/Command/Task/FixtureTask.php @@ -87,6 +87,8 @@ class FixtureTask extends BakeTask { 'help' => __d('cake_console', 'Importing schema for fixtures rather than hardcoding it.'), 'short' => 's', 'boolean' => true + ))->addOption('theme', array( + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('records', array( 'help' => __d('cake_console', 'Used with --count and /all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10.'), 'short' => 'r', diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 3d6e31028..af611160c 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -992,6 +992,8 @@ class ModelTask extends BakeTask { ))->addOption('plugin', array( 'short' => 'p', 'help' => __d('cake_console', 'Plugin to bake the model into.') + ))->addOption('theme', array( + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('connection', array( 'short' => 'c', 'help' => __d('cake_console', 'The connection the model table is on.') diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index 723ea2e19..44827fedb 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -438,6 +438,8 @@ class ProjectTask extends AppShell { ))->addOption('empty', array( 'boolean' => true, 'help' => __d('cake_console', 'Create empty files in each of the directories. Good if you are using git') + ))->addOption('theme', array( + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('skel', array( 'default' => current(App::core('Console')) . 'Templates' . DS . 'skel', 'help' => __d('cake_console', 'The directory layout to use for the new application skeleton. Defaults to cake/Console/Templates/skel of CakePHP used to create the project.') diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index dfc2e50a8..228b41a0c 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -563,6 +563,8 @@ class TestTask extends BakeTask { ) ))->addArgument('name', array( 'help' => __d('cake_console', 'An existing class to bake tests for.') + ))->addOption('theme', array( + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('plugin', array( 'short' => 'p', 'help' => __d('cake_console', 'CamelCased name of the plugin to bake tests for.') diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 7d623cd5b..9886ed798 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -435,6 +435,8 @@ class ViewTask extends BakeTask { ))->addOption('admin', array( 'help' => __d('cake_console', 'Set to only bake views for a prefix in Routing.prefixes'), 'boolean' => true + ))->addOption('theme', array( + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('connection', array( 'short' => 'c', 'help' => __d('cake_console', 'The connection the connected model is on.') From ae3d9a7a8e2152333de49ae191b0bb1ccef712e3 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Wed, 29 May 2013 13:46:13 +0000 Subject: [PATCH 2/4] Remove ` from help line --- lib/Cake/Console/Command/Task/ControllerTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php index 5b2057af2..13a500bf3 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -475,7 +475,7 @@ class ControllerTask extends BakeTask { 'short' => 'c', 'help' => __d('cake_console', 'The connection the controller\'s model is on.') ))->addOption('theme', array( - 'help' => __d('cake_console', 'Theme to use when baking code`.') + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addSubcommand('all', array( 'help' => __d('cake_console', 'Bake all controllers with CRUD methods.') ))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.')); From 5aac41ed43ecfb979d2e9355ac3e078572208f90 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Wed, 29 May 2013 13:49:12 +0000 Subject: [PATCH 3/4] Fix indentation and add short option 't' for template --- lib/Cake/Console/Command/Task/ControllerTask.php | 1 + lib/Cake/Console/Command/Task/FixtureTask.php | 3 ++- lib/Cake/Console/Command/Task/ModelTask.php | 1 + lib/Cake/Console/Command/Task/ProjectTask.php | 1 + lib/Cake/Console/Command/Task/TestTask.php | 1 + lib/Cake/Console/Command/Task/ViewTask.php | 3 ++- 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php index 13a500bf3..920f63241 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -475,6 +475,7 @@ class ControllerTask extends BakeTask { 'short' => 'c', 'help' => __d('cake_console', 'The connection the controller\'s model is on.') ))->addOption('theme', array( + 'short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addSubcommand('all', array( 'help' => __d('cake_console', 'Bake all controllers with CRUD methods.') diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php index 0d425d35b..e3812bb03 100644 --- a/lib/Cake/Console/Command/Task/FixtureTask.php +++ b/lib/Cake/Console/Command/Task/FixtureTask.php @@ -88,7 +88,8 @@ class FixtureTask extends BakeTask { 'short' => 's', 'boolean' => true ))->addOption('theme', array( - 'help' => __d('cake_console', 'Theme to use when baking code.') + 'short' => 't', + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('records', array( 'help' => __d('cake_console', 'Used with --count and /all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10.'), 'short' => 'r', diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index af611160c..a1ef97d58 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -993,6 +993,7 @@ class ModelTask extends BakeTask { 'short' => 'p', 'help' => __d('cake_console', 'Plugin to bake the model into.') ))->addOption('theme', array( + 'short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('connection', array( 'short' => 'c', diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index 44827fedb..ed856bfde 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -439,6 +439,7 @@ class ProjectTask extends AppShell { 'boolean' => true, 'help' => __d('cake_console', 'Create empty files in each of the directories. Good if you are using git') ))->addOption('theme', array( + 'short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('skel', array( 'default' => current(App::core('Console')) . 'Templates' . DS . 'skel', diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index 228b41a0c..fed43cc6f 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -564,6 +564,7 @@ class TestTask extends BakeTask { ))->addArgument('name', array( 'help' => __d('cake_console', 'An existing class to bake tests for.') ))->addOption('theme', array( + 'short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('plugin', array( 'short' => 'p', diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 9886ed798..ab88e2217 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -436,7 +436,8 @@ class ViewTask extends BakeTask { 'help' => __d('cake_console', 'Set to only bake views for a prefix in Routing.prefixes'), 'boolean' => true ))->addOption('theme', array( - 'help' => __d('cake_console', 'Theme to use when baking code.') + 'short' => 't', + 'help' => __d('cake_console', 'Theme to use when baking code.') ))->addOption('connection', array( 'short' => 'c', 'help' => __d('cake_console', 'The connection the connected model is on.') From 2eb9841c54f1324df13a11dfc0dea956dc858eb0 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Wed, 29 May 2013 13:49:51 +0000 Subject: [PATCH 4/4] Add short option for theme in BakeShell --- lib/Cake/Console/Command/BakeShell.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Cake/Console/Command/BakeShell.php b/lib/Cake/Console/Command/BakeShell.php index 880800c9c..fd55ce6ac 100644 --- a/lib/Cake/Console/Command/BakeShell.php +++ b/lib/Cake/Console/Command/BakeShell.php @@ -244,6 +244,7 @@ class BakeShell extends AppShell { 'short' => 'c', 'default' => 'default' ))->addOption('theme', array( + 'short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.') )); }