packages feed

hxmppc 0.2 → 0.2.1

raw patch · 2 files changed

+8/−4 lines, 2 files

Files

hxmppc.cabal view
@@ -1,5 +1,5 @@ Name:                hxmppc-Version:             0.2+Version:             0.2.1  Synopsis:            Haskell XMPP (Jabber Client) Command Line Interface (CLI) Description:         A simple command line interface to send and receive
hxmppc.hs view
@@ -47,6 +47,8 @@                          ,"command ::= tell <destination-user> <message>*"                          ,"          | wait"                          ,""+                         ,"NOTE: reads and sends message from stdin (line by line) if no argument is given to `tell'"+                         ,""                          ,msg                          ] @@ -65,11 +67,13 @@     case map T.pack nonopts of       "tell" : args -> do         case args of-          []  -> usage "`tell' expects a destination user and a message"-          [_] -> usage "`tell' expects a message as well"+          []  -> usage "`tell' expects a destination user and optionally a message"           (to:msg) -> do              toJID <- maybe (usage "`tell' bad format for destination user") return $ parseJID to-             putStanza $ mkMsg toJID (T.unwords msg)+             let say = putStanza . mkMsg toJID+             if null msg+               then mapM_ ((=<<) say) (repeat (liftIO T.getLine))+               else say (T.unwords msg)              _ <- getStanza              liftIO exitSuccess       "wait" : args -> do