summaryrefslogtreecommitdiff
path: root/utils/testremove/wouldrm.hs
blob: 1c68e7563f9f8174915445dec93fa4a652948fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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