diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-03-02 03:54:32 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-03-02 03:54:32 +0000 |
commit | 5c13c5dd9d92c60223829881b9835ee9fb02f400 (patch) | |
tree | 908a64c658caa2ceddac28ae692b5692d081b26a /lib/mongrel/command.rb | |
parent | 58723a54f16e73b6d92a201200f1972283be9b74 (diff) | |
download | unicorn-5c13c5dd9d92c60223829881b9835ee9fb02f400.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@67 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel/command.rb')
-rw-r--r-- | lib/mongrel/command.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/mongrel/command.rb b/lib/mongrel/command.rb index 04af386..db54e1d 100644 --- a/lib/mongrel/command.rb +++ b/lib/mongrel/command.rb @@ -12,7 +12,7 @@ module Mongrel # A Command pattern implementation used to create the set of command available to the user # from Mongrel. The script uses objects which implement this interface to do the # user's bidding. - module Command + module Base attr_reader :valid, :done_validating @@ -31,7 +31,8 @@ module Mongrel # Called by the subclass to setup the command and parse the argv arguments. # The call is destructive on argv since it uses the OptionParser#parse! function. - def initialize(argv) + def initialize(options={}) + argv = options[:argv] @opt = OptionParser.new @valid = true # this is retarded, but it has to be done this way because -h and -v exit @@ -54,7 +55,7 @@ module Mongrel end end - @opt.parse! argv + @opt.parse! options[:argv] end # Returns true/false depending on whether the command is configured properly. @@ -143,7 +144,7 @@ module Mongrel # command exists, set it up and validate it begin - command = PluginManager.instance.create("/commands/#{cmd_name}", args) + command = PluginManager.instance.create("/commands/#{cmd_name}", :argv => args) rescue STDERR.puts "INVALID COMMAND: #$!" print_command_list |