From 880371ef2b4a2cb08f0c36ceba1eee41836bb739 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Fri, 10 Jun 2011 18:46:27 +0530 Subject: make 'rails runner' show usage when run without any options --- railties/lib/rails/commands/runner.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'railties/lib') 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)" -- cgit v1.2.3