]> ruin.nu Git - proglang.git/blobdiff - CompInt.hs
smaller update
[proglang.git] / CompInt.hs
index 1188466da980b4d1886b4d3deff9d5e199fa08fc..298c9f49c8ae3a50fcf220e393bdf99ed994c1bd 100644 (file)
@@ -49,6 +49,10 @@ main = do
        args <- getArgs
        case args of
                [] -> hGetContents stdin >>= run interpret pStms
-               "-c":f:[] -> runFile (writeFile (f++".c") . compile)  pStms f
+               "-c":f:[] -> let file = (f++".c") in do
+                       putStrLn $ "Compiling "++f++" to the C99-compatible file:"++file
+                       runFile (writeFile file . compile)  pStms f
                f:[] -> runFile interpret pStms f
-               _ -> print "Too many arguments"
+               _ -> do
+                       putStrLn "Usage: ./CompInt [-c] <file>"
+                       putStrLn "-c : compile <file> to C99-compatible file"