<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,19 +2,17 @@
 
 require &quot;pastejour/cli&quot;
 
-opts = Pastejour::Cli.new STDOUT, ARGV
-
-if opts.run?
-  if opts.list?
+Pastejour::Cli.new STDOUT, ARGV do |cli|
+  if cli.list?
     Pastejour.list
   elsif $stdin.tty?
-    name = /#{ENV[&quot;USER&quot;]}$/ if opts.name.nil? || opts.name.empty?
+    name = /#{ENV[&quot;USER&quot;]}$/ if cli.name.nil? || cli.name.empty?
     $stdout.write Pastejour.get(name)
     $stdout.flush
   else
-    name = [ENV[&quot;USER&quot;], opts.name].compact.join &quot;-&quot;
+    name = [ENV[&quot;USER&quot;], cli.name].compact.join &quot;-&quot;
     contents = $stdin.read
-    Pastejour.serve name, opts.multiple?, contents
-    $stdout.puts contents if opts.tee?
+    Pastejour.serve name, cli.multiple?, contents
+    $stdout.puts contents if cli.tee?
   end
 end</diff>
      <filename>bin/pastejour</filename>
    </modified>
    <modified>
      <diff>@@ -39,9 +39,11 @@ module Pastejour
         end
 
         opts.separator &quot;&quot;
-
         opts.parse! args
+
         @name = args.shift
+
+        yield self if @run &amp;&amp; block_given?
       end
     end
 
@@ -53,10 +55,6 @@ module Pastejour
       @multiple
     end
 
-    def run?
-      @run
-    end
-
     def tee?
       @tee
     end</diff>
      <filename>lib/pastejour/cli.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>92d41cca49d9b9fc96b3bbef562a91c06ee58ef7</id>
    </parent>
  </parents>
  <author>
    <name>John Barnette</name>
    <email>jbarnette@gmail.com</email>
  </author>
  <url>http://github.com/jbarnette/pastejour/commit/bd6932879a0ab32795c42466b37ee2d0d5d8529d</url>
  <id>bd6932879a0ab32795c42466b37ee2d0d5d8529d</id>
  <committed-date>2009-03-02T10:44:10-08:00</committed-date>
  <authored-date>2009-03-02T10:44:10-08:00</authored-date>
  <message>Keeping command-line utility templates consistent.</message>
  <tree>3d8d2d57a84405e4e4dfa47ffc2b6f8fa5593c9c</tree>
  <committer>
    <name>John Barnette</name>
    <email>jbarnette@gmail.com</email>
  </committer>
</commit>
