aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorask <alekseys.kulikov@gmail.com>2012-04-09 22:26:52 +0600
committerPiotr Sarnacki <drogus@gmail.com>2012-04-13 16:05:25 +0200
commit2f9fdbfb9468ff24a9f52763848c75fe72003522 (patch)
treea3a6ac5dc8b0edd2f1f29e851b649449a062bab2 /railties/lib
parentefa9a1ff8b479b860f2ce7019dd4d50ebc5bf0ef (diff)
downloadrails-2f9fdbfb9468ff24a9f52763848c75fe72003522.tar.gz
rails-2f9fdbfb9468ff24a9f52763848c75fe72003522.tar.bz2
rails-2f9fdbfb9468ff24a9f52763848c75fe72003522.zip
"rails new -h" shows message in rails directory
Diffstat (limited to 'railties/lib')
-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 ada150ceec..8eee82fdf1 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'