summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-08-24 06:21:00 +0000
committerEric Wong <normalperson@yhbt.net>2010-08-28 06:56:19 +0000
commitaa599d00907df159f8b33a62108bfa88f407392e (patch)
treee8af31afe92015283d330b5eab8d525c78cbf561
parentcca4c46dd8cd72afedd9c5d024d47b4554f00c53 (diff)
This fixes a long-standing bug in the output of "unicorn_rails"
where the program name was missing.
(cherry picked from commit 096afc1a8e958cc09b4ce8b3bfe76ce056c7ed69)
-rwxr-xr-xbin/unicorn9
-rwxr-xr-xbin/unicorn_rails2
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