]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - test.hs
handle "import"
[pdns-pipe-nmc.git] / test.hs
diff --git a/test.hs b/test.hs
index 1f19426c139401552e0b9f066df0f9c1382376dd..3a9f8b4e0c4c2c92d4858fbdafbaa9dbf547ff26 100644 (file)
--- 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 Text.Show.Pretty
 
 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
-        d <- descendNmcDom queryOp [] $ seedNmcDom "root"
-        putStrLn $ show d
+        (d:_) <- getArgs
+        descendNmcDom queryOp [] (seedNmcDom d) >>= putStrLn . ppShow