From aa599d00907df159f8b33a62108bfa88f407392e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 24 Aug 2010 06:21:00 +0000 Subject: bin/*: more consistent --help output This fixes a long-standing bug in the output of "unicorn_rails" where the program name was missing. (cherry picked from commit 096afc1a8e958cc09b4ce8b3bfe76ce056c7ed69) --- bin/unicorn | 9 +++++---- bin/unicorn_rails | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/unicorn b/bin/unicorn index 2cc10b1..8d984bd 100755 --- a/bin/unicorn +++ b/bin/unicorn @@ -10,8 +10,9 @@ host, port = Unicorn::Const::DEFAULT_HOST, Unicorn::Const::DEFAULT_PORT set_listener = false opts = OptionParser.new("", 24, ' ') do |opts| - opts.banner = "Usage: #{File.basename($0)} " \ - "[ruby options] [unicorn options] [rackup config file]" + cmd = File.basename($0) + opts.banner = "Usage: #{cmd} " \ + "[ruby options] [#{cmd} options] [rackup config file]" opts.separator "Ruby options:" @@ -39,7 +40,7 @@ opts = OptionParser.new("", 24, ' ') do |opts| require library end - opts.separator "Unicorn options:" + opts.separator "#{cmd} options:" # some of these switches exist for rackup command-line compatibility, @@ -100,7 +101,7 @@ opts = OptionParser.new("", 24, ' ') do |opts| end opts.on_tail("-v", "--version", "Show version") do - puts "unicorn v#{Unicorn::Const::UNICORN_VERSION}" + puts "#{cmd} v#{Unicorn::Const::UNICORN_VERSION}" exit end diff --git a/bin/unicorn_rails b/bin/unicorn_rails index 3614fd4..0b2d92f 100755 --- a/bin/unicorn_rails +++ b/bin/unicorn_rails @@ -100,7 +100,7 @@ opts = OptionParser.new("", 24, ' ') do |opts| end opts.on_tail("-v", "--version", "Show version") do - puts " v#{Unicorn::Const::UNICORN_VERSION}" + puts "#{cmd} v#{Unicorn::Const::UNICORN_VERSION}" exit end -- cgit v1.2.3-24-ge0c7