about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/mongrel/command.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/mongrel/command.rb b/lib/mongrel/command.rb
index 64969b4..7790b64 100644
--- a/lib/mongrel/command.rb
+++ b/lib/mongrel/command.rb
@@ -182,9 +182,13 @@ module Mongrel
         # command exists, set it up and validate it
         begin
           command = GemPlugin::Manager.instance.create("/commands/#{cmd_name}", :argv => args)
+        rescue OptionParser::InvalidOption
+          STDERR.puts "#$! for command '#{cmd_name}'"
+          STDERR.puts "Try #{cmd_name} -h to get help."
+          return false
         rescue
-          STDERR.puts "INVALID COMMAND: #$!"
-          print_command_list
+          STDERR.puts "ERROR RUNNING '#{cmd_name}': #$!"
+          STDERR.puts "Use help command to get help"
           return false
         end