git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #509 from joneshf/docgen-stderr

Use stderr for docgen and hierarchy

commit6b20ec806986a47d3741cb2454aa59100a7a1b87 authorPhil Freeman <paf31@cantab.net> dateSat 26 Jul 2014, 09:44 (12 years ago) parent385c92f7082871
2 files changed+5−3
docgen/Main.hs+3−2 hierarchy/Main.hs+2−1
docgen/Main.hs+3−2
@@ -25,6 +25,7 @@ import qualified Paths_purescript as Paths
2525import qualified System.IO.UTF8 as U
2626import System.Console.CmdTheLine
2727import System.Exit (exitSuccess, exitFailure)
28+import System.IO (stderr)
2829
2930docgen :: Bool -> [FilePath] -> IO ()
3031docgen showHierarchy input = do
@@ -37,7 +38,7 @@ parseFile input = do
3738 text <- U.readFile input
3839 case P.runIndentParser input P.parseModules text of
3940 Left err -> do
40− U.print err
41+ U.hPutStr stderr $ show err
4142 exitFailure
4243 Right ms -> do
4344 return ms
@@ -168,7 +169,7 @@ prettyPrintType' :: P.Type -> String
168169prettyPrintType' = P.prettyPrintType . P.everywhereOnTypes dePrim
169170 where
170171 dePrim ty@(P.TypeConstructor (P.Qualified _ name))
171− | ty == P.tyBoolean || ty == P.tyNumber || ty == P.tyString =
172+ | ty == P.tyBoolean || ty == P.tyNumber || ty == P.tyString =
172173 P.TypeConstructor $ P.Qualified Nothing name
173174 dePrim other = other
174175
hierarchy/Main.hs+2−1
@@ -26,6 +26,7 @@ import System.Console.CmdTheLine
2626import System.Directory (createDirectoryIfMissing)
2727import System.FilePath ((</>))
2828import System.Exit (exitFailure, exitSuccess)
29+import System.IO (stderr)
2930
3031import Text.Parsec (ParseError)
3132
@@ -57,7 +58,7 @@ compile :: FilePath -> Maybe FilePath -> IO ()
5758compile input mOutput = do
5859 modules <- readInput input
5960 case modules of
60− Left err -> U.print err >> exitFailure
61+ Left err -> U.hPutStr stderr (show err) >> exitFailure
6162 Right ms -> do
6263 for_ ms $ \(P.Module moduleName decls _) ->
6364 let name = runModuleName moduleName