<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,5 +3,11 @@
 require File.dirname(__FILE__) + '/../lib/rush'
 require File.dirname(__FILE__) + '/../lib/rush/shell'
 
-Rush::Shell.new.run
+shell = Rush::Shell.new
+
+if ARGV.size &gt; 0
+	shell.execute ARGV.join(' ')
+else
+	shell.run
+end
 </diff>
      <filename>bin/rush</filename>
    </modified>
    <modified>
      <diff>@@ -31,6 +31,21 @@ module Rush
 			Array.class_eval commands
 		end
 
+		# Run a single command.
+		def execute(cmd)
+			res = eval(cmd, @pure_binding)
+			$last_res = res
+			eval(&quot;_ = $last_res&quot;, @pure_binding)
+			print_result res
+		rescue Rush::Exception =&gt; e
+			puts &quot;Exception #{e.class} -&gt; #{e.message}&quot;
+		rescue ::Exception =&gt; e
+			puts &quot;Exception #{e.class} -&gt; #{e.message}&quot;
+			e.backtrace.each do |t|
+				puts &quot;   #{::File.expand_path(t)}&quot;
+			end
+		end
+
 		# Run the interactive shell using readline.
 		def run
 			loop do
@@ -40,19 +55,7 @@ module Rush
 				next if cmd == &quot;&quot;
 				Readline::HISTORY.push(cmd)
 
-				begin
-					res = eval(cmd, @pure_binding)
-					$last_res = res
-					eval(&quot;_ = $last_res&quot;, @pure_binding)
-					print_result res
-				rescue Rush::Exception =&gt; e
-					puts &quot;Exception #{e.class} -&gt; #{e.message}&quot;
-				rescue ::Exception =&gt; e
-					puts &quot;Exception #{e.class} -&gt; #{e.message}&quot;
-					e.backtrace.each do |t|
-						puts &quot;   #{::File.expand_path(t)}&quot;
-					end
-				end
+				execute(cmd)
 			end
 		end
 </diff>
      <filename>lib/rush/shell.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8f658eafd5397c479ff6f6a4ad66b357dde02c91</id>
    </parent>
  </parents>
  <author>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </author>
  <url>http://github.com/adamwiggins/rush/commit/433cfd3e5a71e40c02b084f2aebd15a2fcb02305</url>
  <id>433cfd3e5a71e40c02b084f2aebd15a2fcb02305</id>
  <committed-date>2008-03-27T15:09:15-07:00</committed-date>
  <authored-date>2008-03-27T15:09:15-07:00</authored-date>
  <message>run rush with arguments to execute them instead of interactive shell</message>
  <tree>4bc1d16a0343fdf0e2fd6345af263e27e081df0c</tree>
  <committer>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </committer>
</commit>
