diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2015-02-11 21:30:02 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2015-02-11 21:30:02 -0500 |
commit | 31ef18834d4291b531e2e5a993216fc18f891205 (patch) | |
tree | c93102f5fcb85a64a5d7dc3ee6c7a75626d4e66d | |
parent | dddbd13bb2bcaae6a6562ff7a6f8a439d754b06b (diff) |
Send errors to stderr
-rw-r--r-- | src/Main.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs index fef9a9c..9f35e16 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -22,6 +22,7 @@ import GHC.Generics (Generic) import Data.Functor ((<$>)) import System.Environment (getArgs) import System.Exit (exitFailure) +import System.IO (hPutStrLn, stderr) import Fragment (parseFragments) import Tangle (tangle) @@ -48,7 +49,7 @@ main = do input <- case file of Nothing -> getContents Just path -> readFile path case doOperation op (pathString, input) of - Left err -> putStrLn err >> exitFailure + Left err -> hPutStrLn stderr err >> exitFailure Right result -> putStr result doOperation :: Operation -> (FilePath, String) -> Either String String |