diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-05-21 23:04:24 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-05-21 23:04:24 -0700 |
commit | d22859ed9712cfa27b83225d8363d0f92261335a (patch) | |
tree | 66d95d8ac395ce244ab103e6e77bb2fa10efd087 /railties/lib/rails | |
parent | 1447aca70f231f07eedee9572bd45da6a175262b (diff) | |
parent | 1fed1f14fc0ecb375d8a7c542669dad96541582d (diff) | |
download | rails-d22859ed9712cfa27b83225d8363d0f92261335a.tar.gz rails-d22859ed9712cfa27b83225d8363d0f92261335a.tar.bz2 rails-d22859ed9712cfa27b83225d8363d0f92261335a.zip |
Merge pull request #6150 from avakhov/dbconsole-fixes
Rails db console improvements
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/commands/console.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/dbconsole.rb | 9 | ||||
-rw-r--r-- | railties/lib/rails/commands/runner.rb | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb index cd6a03fe51..b95df3e545 100644 --- a/railties/lib/rails/commands/console.rb +++ b/railties/lib/rails/commands/console.rb @@ -22,7 +22,7 @@ module Rails options = {} OptionParser.new do |opt| - opt.banner = "Usage: console [environment] [options]" + opt.banner = "Usage: rails console [environment] [options]" opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |v| options[:sandbox] = v } opt.on("-e", "--environment=name", String, "Specifies the environment to run this console under (test/development/production).", diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index aaba47117f..cc7caffc3d 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -42,7 +42,7 @@ module Rails include_password = false options = {} OptionParser.new do |opt| - opt.banner = "Usage: dbconsole [environment] [options]" + opt.banner = "Usage: rails dbconsole [environment] [options]" opt.on("-p", "--include-password", "Automatically provide the password from database.yml") do |v| include_password = true end @@ -56,6 +56,11 @@ module Rails options['header'] = h end + opt.on("-h", "--help", "Show this help message.") do + puts opt + exit + end + opt.parse!(arguments) abort opt.to_s unless (0..1).include?(arguments.size) end @@ -96,7 +101,7 @@ module Rails args << "-#{options['mode']}" if options['mode'] args << "-header" if options['header'] - args << config['database'] + args << File.expand_path(config['database'], Rails.root) find_cmd_and_exec('sqlite3', *args) diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index 2802981e7a..77f1b15fb4 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -9,7 +9,7 @@ if ARGV.first.nil? end ARGV.clone.options do |opts| - opts.banner = "Usage: runner [options] ('Some.ruby(code)' or a filename)" + opts.banner = "Usage: rails runner [options] ('Some.ruby(code)' or a filename)" opts.separator "" |