aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/commands.rb')
-rw-r--r--railties/lib/rails/commands.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
index d4d8d3ac75..df2ed94654 100644
--- a/railties/lib/rails/commands.rb
+++ b/railties/lib/rails/commands.rb
@@ -1,5 +1,3 @@
-ARGV << '--help' if ARGV.empty?
-
aliases = {
"g" => "generate",
"d" => "destroy",
@@ -10,10 +8,15 @@ aliases = {
"t" => "test",
}
-command = ARGV.shift
-command = aliases[command] || command
+if ARGV.empty?
+ ARGV << '--help'
+ command = ''
+else
+ command = ARGV.shift
+ command = aliases[command] || command
+end
+require 'rails/commands/command'
require 'rails/commands/dev_cache'
-require 'rails/commands/commands_tasks'
-Rails::CommandsTasks.new(ARGV).run_command!(command)
+Rails::Commands::Command.run(command, ARGV)