aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-04-09 10:21:28 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2012-04-09 10:21:28 -0700
commit84adc214985ff7a2c02d120ca364b6f3771cb3b3 (patch)
tree8d40008142636941f1684f100b766356c760d86d /railties/lib/rails
parente065312a146a642045d66d213b727128135e8144 (diff)
parent4bb76eecfef844c33e141dc9e167b9fc281fe83d (diff)
downloadrails-84adc214985ff7a2c02d120ca364b6f3771cb3b3.tar.gz
rails-84adc214985ff7a2c02d120ca364b6f3771cb3b3.tar.bz2
rails-84adc214985ff7a2c02d120ca364b6f3771cb3b3.zip
Merge pull request #5788 from Ask11/rails_new_help
"rails new -h" shows message in rails directory
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/commands.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
index 71fe604e69..82cdd6053b 100644
--- a/railties/lib/rails/commands.rb
+++ b/railties/lib/rails/commands.rb
@@ -64,9 +64,13 @@ when 'application', 'runner'
require "rails/commands/#{command}"
when 'new'
- puts "Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.\n"
- puts "Type 'rails' for help."
- exit(1)
+ if ARGV.first.in?(['-h', '--help'])
+ require 'rails/commands/application'
+ else
+ puts "Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.\n"
+ puts "Type 'rails' for help."
+ exit(1)
+ end
when '--version', '-v'
ARGV.unshift '--version'