module Main where
import System
import HandleMain
import Regexp
main = getArgs >>= \argv -> 
       case argv of
         (inp:out:[]) -> 
                         readFile inp >>= \contents -> 
                         writeFile out (re2hsrepl contents) 
         _ -> putStr usage_msg


usage_msg :: String
usage_msg
 = unlines
    ["Usage:  re2hs infile outfile",
     "where",
     "        infile - is the file with re2hs code",
     "        outfile - is the equivalent Haskell program"]
