<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Infinity/Plugins/Check.hs</filename>
    </added>
    <added>
      <filename>Infinity/Plugins/Unlambda.hs</filename>
    </added>
    <added>
      <filename>util/Unlambda.hs</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -9,9 +9,9 @@ import Data.List
 
 -- | This represents the different types of information
 -- that can come from IRC over the wire.
-data IrcLine = Cmd  User Channel (Command,Maybe Args) -- ^ A command sent over the line
-             | Line User Channel String               -- ^ A normal line of little significance
-             | Err String                             -- ^ An error occured in parsing.
+data IrcLine = Cmd  User Channel (Command,Maybe String) -- ^ A command sent over the line
+             | Line User Channel String                 -- ^ A normal line of little significance
+             | Err String                               -- ^ An error occured in parsing.
  deriving (Eq,Show)
 
 
@@ -31,7 +31,7 @@ parseIRCmsg cprefix s =
                         let cmd  = (head . words) str'
                             args = (tail . words) str'
                             av = if null args then
-                                  Nothing else Just args in
+                                  Nothing else Just (unwords args) in
                         (Cmd nick to (cmd,av))
                      else (Line nick to str')
                  else (Line nick to str')</diff>
      <filename>Infinity/IRC.hs</filename>
    </modified>
    <modified>
      <diff>@@ -151,14 +151,16 @@ listener plugins rchan rebootvar x@(serv,handle) = infinity $ do
                   let cmd' = tail cmd
                   case av of
                     Nothing -&gt; irclog (C.address serv) (u,c,cmd)
-                    Just s -&gt;  irclog (C.address serv) (u,c,cmd++&quot; &quot;++(unwords s))
+                    Just s  -&gt; irclog (C.address serv) (u,c,cmd++&quot; &quot;++s)
                   unless (null cmd') $ do
                     let ctx = IContext serv handle
                     (str,plugins') &lt;- runplugin ctx plugins cmd' av
+#ifdef DEBUG
+                    logs Normal $ &quot;Output of \'&quot;++cmd'++&quot;\', with args \'&quot;++(show av)++&quot;\':   &quot;++str
+#endif
                     privmsg handle c str
                     irclog (C.address serv) ((C.nickname serv),c,str)
 
-
 --  Loops a function forever
 infinity a = a &gt;&gt; forever a
 </diff>
      <filename>Infinity/Main.hs</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,6 @@ module Infinity.Plugins (
  -- $pfuncs
  ircPrivmsg,
  runProc,
- runUtil,
  -- $plugactions
  findplugin,
  runplugin, saveplugin,
@@ -77,10 +76,10 @@ class (Binary st, Show st) =&gt; Plugin a st | a -&gt; st where
     exec   :: a                     -- ^ Phantom
            -&gt; st                    -- ^ State
            -&gt; String                -- ^ Command
-           -&gt; Maybe [String]        -- ^ Arguments
+           -&gt; Maybe String          -- ^ Argument
            -&gt; IPluginT (st,String)  -- ^ Return string
 
-
+    serial _ = False
 
 -- $pfunc
 -- These are functions that are available to plugins
@@ -104,16 +103,6 @@ runProc :: FilePath                 -- ^ Executable name
 runProc f av str = io (run f av str)
 
 
--- | Runs a utility process that resides in
--- utils/ of the infinity source tree.
-runUtil :: FilePath                 -- ^ Name of utility process
-        -&gt; [String]                 -- ^ Command line parameters
-        -&gt; Maybe String             -- ^ Any input
-        -&gt; IPluginT (String,String) -- ^ Command output and output from stderr, respectively
-runUtil file = runProc (&quot;utils&quot; &lt;/&gt; file)
-
-
-
 
 
 -- $plugactions
@@ -144,7 +133,7 @@ saveplugin (IModule (p,st,_)) = when (serial p) $ putState (show p) st
 runplugin :: IContext       -- ^ Execution context
           -&gt; [IModule]      -- ^ List of plugins
           -&gt; String         -- ^ Command name
-          -&gt; Maybe [String] -- ^ Arguments
+          -&gt; Maybe String   -- ^ Arguments
           -&gt; IO (String,[IModule]) 
 runplugin ctx mods cmd av = do
   case (findplugin mods cmd) of</diff>
      <filename>Infinity/Plugins.hs</filename>
    </modified>
    <modified>
      <diff>@@ -7,13 +7,12 @@ data Fortune = Fortune
  deriving (Eq,Show)
 
 instance Plugin Fortune () where
-    serial _ = False
-    pinit  _ = ()
-    cmds   _ = [&quot;fortune&quot;]
-
+    pinit _          = ()
+    cmds _           = [&quot;fortune&quot;]
     help _ &quot;fortune&quot; = &quot;prints a random fortune&quot;
 
     exec _ _ &quot;fortune&quot; _ = do
-      (o,_) &lt;- runProc &quot;fortune&quot; [&quot;-s&quot;] Nothing
-      let s = map (\x -&gt; if isControl x then ' ' else x) o
+      (o,e) &lt;- runProc &quot;fortune&quot; [&quot;-s&quot;] Nothing
+      let s = clean $ if (null e) then o else e
       return ((), s)
+          where clean = map (\x -&gt; if isControl x then ' ' else x)</diff>
      <filename>Infinity/Plugins/Fortune.hs</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,6 @@ data HelloWorld = HelloWorld
  deriving (Eq,Show)
 
 instance Plugin HelloWorld () where
-    serial _ = False
     pinit  _ = ()
     cmds   _ = [&quot;hi&quot;,&quot;bye&quot;]
 </diff>
      <filename>Infinity/Plugins/HelloWorld.hs</filename>
    </modified>
    <modified>
      <diff>@@ -25,4 +25,4 @@ instance Plugin StateTest ST where
 
     exec _ x@(ST s) &quot;get&quot; _        = return (x,s)
     exec _ x        &quot;put&quot; Nothing  = return (x,&quot;I need some data...&quot;)
-    exec _ _        &quot;put&quot; (Just x) = return (ST (unwords x),&quot;Done&quot;)
+    exec _ _        &quot;put&quot; (Just x) = return (ST x,&quot;Done&quot;)</diff>
      <filename>Infinity/Plugins/StateTest.hs</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ module Infinity.Util (
  unlessM, whenM, mkdate, mktime, mkdir, ci,
  run,
  -- * Types
- User, Channel, Command, Args, Nick, Cmds
+ User, Channel, Command, Nick, Cmds
 ) where
 import Data.List
 import System.IO
@@ -20,7 +20,6 @@ type Nick    = String
 type User    = String
 type Channel = String
 type Command = String
-type Args    = [String]
 type Cmds    = [String]
 
 -- | Runs an executable program, returning output and anything from stderr</diff>
      <filename>Infinity/Util.hs</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,14 @@ import System.Info
 import System.Exit
 import List
 
-bin  = &quot;infinity&quot;                                        -- files to remove
-dirs = [&quot;.&quot;,&quot;Tests&quot;,&quot;Infinity&quot;,&quot;Infinity&quot; &lt;/&gt; &quot;Plugins&quot;] -- directories to clean
+inf  = &quot;infinity&quot;
+bins = [inf] ++ 
+       [&quot;util&quot; &lt;/&gt; &quot;unlambda&quot;]    -- files to remove
+dirs = [ &quot;.&quot;
+       , &quot;Tests&quot;
+       , &quot;util&quot;
+       , &quot;Infinity&quot;
+       , &quot;Infinity&quot; &lt;/&gt; &quot;Plugins&quot;] -- directories to clean
 
 main = defaultMainWithHooks $ defaultUserHooks {
       runTests  = tests,
@@ -21,11 +27,11 @@ main = defaultMainWithHooks $ defaultUserHooks {
 tests _ _ _ _ = P.main
 
 copyInfinity _ _ _ _ = do
-  copyFile (joinPath [&quot;dist&quot;,&quot;build&quot;,&quot;infinity&quot;,bin]) bin
+  copyFile (joinPath [&quot;dist&quot;,&quot;build&quot;,&quot;infinity&quot;,inf]) inf
   ignore (createDirectory &quot;Log&quot; &gt;&gt; createDirectory &quot;State&quot;)
 
 cleanInfinity _ _ _ _ = do
-  ignore (removeFile bin)
+  mapM_ (ignore . removeFile) bins
   mapM_ clean dirs
  where
    clean d   = getDirectoryContents d &gt;&gt;= mapM_ (check d)</diff>
      <filename>Setup.hs</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ flag debug
   description:       Enables static build with code coverage and debug output
   default:           False
 
-
+-- the bot executable
 executable infinity
   main-is:           Main.hs
   build-depends:     binary &gt;= 0.4, filepath, irc &gt;= 0.4, base,
@@ -62,3 +62,10 @@ executable infinity
       ghc-options:   -DSTATIC_BUILD
   else
     build-depends:   plugins &gt;= 1.1
+
+-- utilities
+-- unlambda
+executable unlambda
+  main-is:           util/Unlambda.hs
+  build-depends:     base &gt;= 3.0.1.0
+  ghc-options:       -o util/unlambda</diff>
      <filename>infinity.cabal</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>378c87fdaf5f4264f025d0090b4f1819ee7f9fde</id>
    </parent>
  </parents>
  <author>
    <name>Austin Seipp</name>
    <email>austin@youareinferior.net</email>
  </author>
  <url>http://github.com/thoughtpolice/infinity/commit/d85a67a21dc4a858c1ac846e0c008cab0c20b29b</url>
  <id>d85a67a21dc4a858c1ac846e0c008cab0c20b29b</id>
  <committed-date>2008-01-18T14:36:30-08:00</committed-date>
  <authored-date>2008-01-18T14:36:30-08:00</authored-date>
  <message>Added Unlambda plugin from Lambdabot
Also I changed around the inner structure of plugin types a
little, now plugins just get a single string for their command
arguments rather than [String]</message>
  <tree>4b9006b2b2e76c03493efa85c56b3c1cd3e56ea5</tree>
  <committer>
    <name>Austin Seipp</name>
    <email>austin@youareinferior.net</email>
  </committer>
</commit>
