<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/commands_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,21 +3,4 @@
 require 'rip'
 require 'rip/commands'
 
-def parse_args(args)
-  command = args.shift
-  options = args.select { |piece| piece =~ /^-/ }
-  args   -= options
-  options = options.inject({}) do |hash, flag|
-    key, value = flag.split('=')
-    hash[key.sub(/^--?/,'').intern] = value.nil? ? true : value
-    hash
-  end
-
-  [command, options, args]
-end
-
-if $0 == __FILE__
-  command, options, args = parse_args(ARGV)
-
-  Rip::Commands.invoke(command, options, *args)
-end
+Rip::Commands.invoke(ARGV)</diff>
      <filename>bin/rip</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,9 @@ module Rip
   module Commands
     extend self
 
-    def invoke(command, options, *args)
+    def invoke(args)
+      command, options, args = parse_args(args)
+
       if command.nil? || command == ''
         command = :help
       end
@@ -67,6 +69,19 @@ module Rip
         ui.abort &quot;rip: which command did you mean? #{matches.join(' or ')}&quot;
       end
     end
+
+    def parse_args(args)
+      command = args.shift
+      options = args.select { |piece| piece =~ /^-/ }
+      args   -= options
+      options = options.inject({}) do |hash, flag|
+        key, value = flag.split('=')
+        hash[key.sub(/^--?/,'').intern] = value.nil? ? true : value
+        hash
+      end
+
+      [command, options, args]
+    end
   end
 end
 </diff>
      <filename>lib/rip/commands.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/bin_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>52ad971d18980e044c31885270a2e5e29d410591</id>
    </parent>
  </parents>
  <author>
    <name>Chris Wanstrath</name>
    <email>chris@ozmm.org</email>
  </author>
  <url>http://github.com/nkryptic/rip/commit/9f1d76a16ebc667cbc4f1a2eadf768f40c154e1d</url>
  <id>9f1d76a16ebc667cbc4f1a2eadf768f40c154e1d</id>
  <committed-date>2009-06-10T19:04:36-07:00</committed-date>
  <authored-date>2009-06-10T19:04:36-07:00</authored-date>
  <message>bin_test =&gt; commands_test, strip everything out of the runner</message>
  <tree>24797e6095b97f855f2448c0754acb0b3942a875</tree>
  <committer>
    <name>Chris Wanstrath</name>
    <email>chris@ozmm.org</email>
  </committer>
</commit>
