From 31ef18834d4291b531e2e5a993216fc18f891205 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 11 Feb 2015 21:30:02 -0500 Subject: Send errors to stderr --- src/Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3