X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=test.hs;h=6f98fc677359edce6dabda7fe631a640a19ff247;hp=3bcd4bc12187fffcbe08faff6f915540d50ebb46;hb=c3a4cdbe13176c6b6327c7bac775d0bc6be2819c;hpb=9215cada18937561801da2d0a42b916669f8fa1a diff --git a/test.hs b/test.hs index 3bcd4bc..6f98fc6 100644 --- a/test.hs +++ b/test.hs @@ -3,18 +3,21 @@ module Main where import Prelude hiding (readFile) +import System.Environment import Data.ByteString.Lazy (ByteString) import Data.ByteString.Lazy.Char8 (readFile) import System.IO.Error import Control.Exception import NmcDom +import NmcTransform queryOp :: String -> IO (Either String ByteString) queryOp key = catch (readFile key >>= return . Right) (\e -> return (Left (show (e :: IOException)))) main = do - descendNmcDom queryOp [] (seedNmcDom "root") >>= print - descendNmcDom queryOp ["_tcp","_smtp"] (seedNmcDom "root") >>= print + (d:_) <- getArgs + descendNmcDom queryOp [] (seedNmcDom d) >>= print + descendNmcDom queryOp ["_tcp","_smtp"] (seedNmcDom d) >>= print