diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-06-10 18:46:27 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-06-10 18:48:50 +0530 |
commit | 880371ef2b4a2cb08f0c36ceba1eee41836bb739 (patch) | |
tree | 1494b6adf828bfe98450c61942a9a7ce80c540ce /railties/lib/rails/commands | |
parent | 78acd17f3124a22485aa1bdcc64d7d1e6e69cb2d (diff) | |
download | rails-880371ef2b4a2cb08f0c36ceba1eee41836bb739.tar.gz rails-880371ef2b4a2cb08f0c36ceba1eee41836bb739.tar.bz2 rails-880371ef2b4a2cb08f0c36ceba1eee41836bb739.zip |
make 'rails runner' show usage when run without any options
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/runner.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index f8b00e7249..e8cc5d9e3b 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -4,6 +4,10 @@ require 'rbconfig' options = { :environment => (ENV['RAILS_ENV'] || "development").dup } code_or_file = nil +if ARGV.first.nil? + ARGV.push "-h" +end + ARGV.clone.options do |opts| script_name = File.basename($0) opts.banner = "Usage: runner [options] ('Some.ruby(code)' or a filename)" |