Add tools to test that cleaning works properly
[ghc-hetmet.git] / utils / testremove / wouldrm.hs
diff --git a/utils/testremove/wouldrm.hs b/utils/testremove/wouldrm.hs
new file mode 100644 (file)
index 0000000..1c68e75
--- /dev/null
@@ -0,0 +1,16 @@
+
+module Main (main) where
+
+import System.Environment
+
+data CleanWhat = CleanFile FilePath
+               | CleanRec  FilePath
+    deriving (Read, Show)
+
+main :: IO ()
+main = do args <- getArgs
+          ls <- case args of
+                "CLEAN_FILES" : files -> return $ map CleanFile files
+                "CLEAN_REC"   : dirs  -> return $ map CleanRec dirs
+                _ -> error "Bad args"
+          appendFile "would-be-cleaned" $ unlines $ map show ls