aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorask <alekseys.kulikov@gmail.com>2012-04-09 22:26:52 +0600
committerask <alekseys.kulikov@gmail.com>2012-04-09 22:26:52 +0600
commit4bb76eecfef844c33e141dc9e167b9fc281fe83d (patch)
treedd2d11dc20d6c41761f198e48d8d43b7d0986890 /railties/lib/rails
parent4c1dcb05373f667be90a69bfb2b642efe75e9d18 (diff)
downloadrails-4bb76eecfef844c33e141dc9e167b9fc281fe83d.tar.gz
rails-4bb76eecfef844c33e141dc9e167b9fc281fe83d.tar.bz2
rails-4bb76eecfef844c33e141dc9e167b9fc281fe83d.zip
"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'