<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,7 +14,7 @@ module Gitjour
       def run(*args)
         case args.shift
           when &quot;list&quot;
-            list
+            list(*args)
           when &quot;clone&quot;
             clone(*args)
           when &quot;serve&quot;
@@ -27,17 +27,24 @@ module Gitjour
       end
 
       private
-			def list
-				service_list.each do |service|
-          puts &quot;=== #{service.name} on #{service.host}:#{service.port} ===&quot;
-          puts &quot;  gitjour clone #{service.name}&quot;
-          if service.description != '' &amp;&amp; service.description !~ /^Unnamed repository/
-            puts &quot;  #{service.description}&quot;
+			def list(*args)
+        timeout =
+          if args.first.to_i.to_s == args.first
+            args.first.to_i
           end
-          puts
-        end
+          
+				service_list(timeout)
 			end
 
+      def show_service(service)
+        puts &quot;=== #{service.name} on #{service.host}:#{service.port} ===&quot;
+        puts &quot;  gitjour clone #{service.name}&quot;
+        if service.description != '' &amp;&amp; service.description !~ /^Unnamed repository/
+          puts &quot;  #{service.description}&quot;
+        end
+        puts
+      end
+
       def clone(repository_name, *rest)
         dir = rest.shift || repository_name
         if File.exists?(dir)
@@ -94,7 +101,7 @@ module Gitjour
         puts &quot;Serve up and use git repositories via Bonjour/DNSSD.&quot;
         puts &quot;\nUsage: gitjour &lt;command&gt; [args]&quot;
         puts
-        puts &quot;  list&quot;
+        puts &quot;  list &lt;timeout&gt;&quot;
         puts &quot;      Lists available repositories.&quot;
         puts
         puts &quot;  clone &lt;project&gt; [&lt;directory&gt;]&quot;
@@ -132,15 +139,22 @@ module Gitjour
                                      resolve_reply.port,
                                      resolve_reply.text_record['description'].to_s)
             begin
-              yield service
+              show_service service
             rescue Done
               waiting_thread.run
             end
           end
         end
 
-        puts &quot;Gathering for up to #{timeout} seconds...&quot;
-        sleep timeout
+        if timeout
+          puts &quot;Gathering for up to #{timeout} seconds...&quot;
+          sleep timeout
+        else
+          puts &quot;Gathering until interrupted(^C)...&quot;
+          loop do
+            sleep 10
+          end
+        end
         dns.stop
       end
 
@@ -157,9 +171,9 @@ module Gitjour
         return found
       end
 
-      def service_list
+      def service_list(timeout)
         list = Set.new
-        discover { |obj| list &lt;&lt; obj }
+        discover(timeout) { |obj| list &lt;&lt; obj }
 
         return list
       end</diff>
      <filename>lib/gitjour.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c2d1623b0501b1ac86d3d669485bac13bb533bf6</id>
    </parent>
  </parents>
  <author>
    <name>Elijah Miller</name>
    <email>elijah.miller@gmail.com</email>
  </author>
  <url>http://github.com/lachlanhardy/gitjour/commit/eba5e3276b5a1ee809804588f8878630878ce23c</url>
  <id>eba5e3276b5a1ee809804588f8878630878ce23c</id>
  <committed-date>2009-03-20T20:50:17-07:00</committed-date>
  <authored-date>2008-12-03T09:41:08-08:00</authored-date>
  <message>Support for passing the timeout paramater to list and infinite timeout, also shows repositories immediatley upon detection.

Signed-off-by: Lachlan Hardy &lt;lachlan@lachstock.com.au&gt;</message>
  <tree>413d31e82abe5133ca82cfbc114cce39aa362cfd</tree>
  <committer>
    <name>Lachlan Hardy</name>
    <email>lachlan@lachstock.com.au</email>
  </committer>
</commit>
