Skip to content

Commit

Permalink
Make text consistent in help text of rails server and console commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydev committed Aug 21, 2014
1 parent 54cf7c5 commit af63e4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions railties/lib/rails/commands/console.rb
Expand Up @@ -14,16 +14,16 @@ def parse_arguments(arguments)

OptionParser.new do |opt|
opt.banner = "Usage: rails console [environment] [options]"
opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |v| options[:sandbox] = v }
opt.on('-s', '--sandbox', 'Rollbacks database modifications on exit.') { |v| options[:sandbox] = v }

This comment has been minimized.

Copy link
@matthewd

matthewd Aug 21, 2014

Member

Apart from "rollbacks" not being a word, I think the previous spelling is superior.. options don't do things, they request/nominate behaviours of the command.

(Contrast "specifies", which does describe what the option is doing.)

This comment has been minimized.

Copy link
@vijaydev

vijaydev Aug 22, 2014

Author Member

Doh! I've changed to the previous version here. Thanks @matthewd

opt.on("-e", "--environment=name", String,
"Specifies the environment to run this console under (test/development/production).",
"Default: development") { |v| options[:environment] = v.strip }
opt.on("--debugger", 'Enable the debugger.') do |v|
opt.on("--debugger", 'Enables the debugger.') do |v|
if RUBY_VERSION < '2.0.0'
options[:debugger] = v
else
puts "=> Notice: debugger option is ignored since ruby 2.0 and " \
"it will be removed in future versions"
puts "=> Notice: debugger option is ignored since Ruby 2.0 and " \
"it will be removed in future versions."
end
end
opt.parse!(arguments)
Expand Down
18 changes: 9 additions & 9 deletions railties/lib/rails/commands/server.rb
Expand Up @@ -20,20 +20,20 @@ def parse!(args)

def option_parser(options)
OptionParser.new do |opts|
opts.banner = "Usage: rails server [mongrel, thin, etc] [options]"
opts.banner = "Usage: rails server [Mongrel, Thin etc] [options]"

This comment has been minimized.

Copy link
@soundarapandian

soundarapandian Aug 21, 2014

@vijaydev I think [mongrel, thin, etc] is not part of help text. Its part of command. It conveys that the user can start rails server with any one of their preferred server.

rails server thin

rails server mongrel

Due to capitalized server names in help text the beginner Rails developer may think that they should give capitalized server names. By the way capitalized server names also works. Nobody will prefer command in below format.

rails server Thin

rails server Mongrel

This comment has been minimized.

Copy link
@zzak

zzak Aug 21, 2014

Member

👍 this is the command, not the name of the thing

This comment has been minimized.

Copy link
@vijaydev

vijaydev Aug 22, 2014

Author Member

Agreed and changed in 285a9f0

opts.on("-p", "--port=port", Integer,
"Runs Rails on the specified port.", "Default: 3000") { |v| options[:Port] = v }
opts.on("-b", "--binding=ip", String,
"Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| options[:Host] = v }
opts.on("-b", "--binding=IP", String,
"Binds Rails to the specified IP.", "Default: 0.0.0.0") { |v| options[:Host] = v }
opts.on("-c", "--config=file", String,
"Use custom rackup configuration file") { |v| options[:config] = v }
opts.on("-d", "--daemon", "Make server run as a Daemon.") { options[:daemonize] = true }
opts.on("-u", "--debugger", "Enable the debugger") do
"Uses a custom rackup configuration.") { |v| options[:config] = v }
opts.on("-d", "--daemon", "Runs server as a Daemon.") { options[:daemonize] = true }
opts.on("-u", "--debugger", "Enables the debugger.") do
if RUBY_VERSION < '2.0.0'
options[:debugger] = true
else
puts "=> Notice: debugger option is ignored since ruby 2.0 and " \
"it will be removed in future versions"
puts "=> Notice: debugger option is ignored since Ruby 2.0 and " \
"it will be removed in future versions."
end
end
opts.on("-e", "--environment=name", String,
Expand All @@ -45,7 +45,7 @@ def option_parser(options)

opts.separator ""

opts.on("-h", "--help", "Show this help message.") { puts opts; exit }
opts.on("-h", "--help", "Shows this help message.") { puts opts; exit }
end
end
end
Expand Down

0 comments on commit af63e4a

Please sign in to comment.