summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/dht.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/dht.hs b/examples/dht.hs
index 534a319b..3e1b1656 100644
--- a/examples/dht.hs
+++ b/examples/dht.hs
@@ -4,6 +4,7 @@ import Control.Monad
4import Data.Function 4import Data.Function
5import Control.Monad.IO.Class 5import Control.Monad.IO.Class
6import Data.Char 6import Data.Char
7import Data.List
7import Network.Socket as Socket 8import Network.Socket as Socket
8import System.Console.Haskeline 9import System.Console.Haskeline
9import System.Environment 10import System.Environment
@@ -82,5 +83,8 @@ main = do
82 -- or else we enter an interactive shell. 83 -- or else we enter an interactive shell.
83 args <- dropWhile isSpace . unwords <$> liftIO getArgs 84 args <- dropWhile isSpace . unwords <$> liftIO getArgs
84 case args of 85 case args of
85 (_:_) -> sendCommand h args >> sendCommand h "quit" 86 (_:_) -> do
87 let cs = filter (not . null) $ map (drop 1) $ groupBy (\_ c -> (c/=';')) (';':args)
88 forM_ cs $ \cmd -> sendCommand h cmd
89 sendCommand h "quit"
86 _ -> fix $ interactiveMode h 90 _ -> fix $ interactiveMode h