diff options
author | ask <alekseys.kulikov@gmail.com> | 2012-04-09 22:26:52 +0600 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-04-13 16:05:25 +0200 |
commit | 2f9fdbfb9468ff24a9f52763848c75fe72003522 (patch) | |
tree | a3a6ac5dc8b0edd2f1f29e851b649449a062bab2 /railties/lib/rails | |
parent | efa9a1ff8b479b860f2ce7019dd4d50ebc5bf0ef (diff) | |
download | rails-2f9fdbfb9468ff24a9f52763848c75fe72003522.tar.gz rails-2f9fdbfb9468ff24a9f52763848c75fe72003522.tar.bz2 rails-2f9fdbfb9468ff24a9f52763848c75fe72003522.zip |
"rails new -h" shows message in rails directory
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/commands.rb | 10 |
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' |