<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,8 @@
+=== 0.2.0 / 2009-04-22
+
+* Allow specification of args instead of ARGV so that scripts can
+  handle command line parsing and validation prior to spawning.
+
 === 0.1.0 / 2009-01-26
 
 * 1 major enhancement</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require &quot;fileutils&quot;
 # Large portions of this were liberally stolen from the
 # 'simple-daemon' project at http://simple-daemon.rubyforge.org/
 module DaemonSpawn
-  VERSION = '0.1.0'
+  VERSION = '0.2.0'
 
   def self.usage(msg=nil) #:nodoc:
     print &quot;#{msg}, &quot; if msg
@@ -120,11 +120,14 @@ module DaemonSpawn
     # - &lt;tt&gt;:sync_log&lt;/tt&gt; -- indicate whether or not to sync log IO
     # - &lt;tt&gt;:singleton&lt;/tt&gt; -- If set to true, only one instance is
     # allowed to start
-    def self.spawn!(opts={ })
-      case ARGV.size &gt; 0 &amp;&amp; ARGV.shift
+    # args must begin with 'start', 'stop', 'status', or 'restart'.
+    # The first token will be removed and any remaining arguments
+    # passed to the daemon's start method.
+    def self.spawn!(opts={ }, args=ARGV)
+      case args.size &gt; 0 &amp;&amp; args.shift
       when 'start'
         daemon = self.new(opts)
-        DaemonSpawn.start(daemon, ARGV)
+        DaemonSpawn.start(daemon, args)
       when 'stop'
         daemon = self.new(opts)
         DaemonSpawn.stop(daemon)
@@ -138,7 +141,7 @@ module DaemonSpawn
       when 'restart'
         daemon = self.new(opts)
         DaemonSpawn.stop(daemon)
-        DaemonSpawn.start(daemon, ARGV)
+        DaemonSpawn.start(daemon, args)
       when '-h', '--help', 'help'
         DaemonSpawn.usage
         exit</diff>
      <filename>lib/daemon-spawn.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0dd52c3c7a6fa07128a8cddd0088948e9575a0dc</id>
    </parent>
  </parents>
  <author>
    <name>Seth Falcon</name>
    <email>seth@evri.com</email>
  </author>
  <url>http://github.com/alexvollmer/daemon-spawn/commit/ac38fad2b9ed693f7ec67d44bd621f5cc5776ec5</url>
  <id>ac38fad2b9ed693f7ec67d44bd621f5cc5776ec5</id>
  <committed-date>2009-04-22T13:30:51-07:00</committed-date>
  <authored-date>2009-04-22T13:30:51-07:00</authored-date>
  <message>Allow specification of args instead of ARGV

This allows a script to handle command line argument parsing and
validation prior to spawning the daemon with the oportunity to provide
an operator with useful feedback on the stdout if bad parameters were
specified.</message>
  <tree>97291fe86087a540bf60eec481201f5a4fa35cb1</tree>
  <committer>
    <name>Seth Falcon</name>
    <email>seth@evri.com</email>
  </committer>
</commit>
