git.iko.soy/typeable/pandoc
on master help sign in
Shared: changed err and warn output.

Don't print program name in either case. Print [warning] for warnings.

commit7bf0813814eb3df65ba2190ecd9555df2ae251ae authorJohn MacFarlane <jgm@berkeley.edu> dateSat 3 Dec 2016, 23:12 (10 years ago) parentc55a98f
1 file changed+2−5
src/Text/Pandoc/Shared.hs+2−5
src/Text/Pandoc/Shared.hs+2−5
@@ -108,7 +108,6 @@ import Text.Pandoc.MediaBag (MediaBag, lookupMedia)
108108import Text.Pandoc.Builder (Inlines, Blocks, ToMetaValue(..))
109109import qualified Text.Pandoc.Builder as B
110110import qualified Text.Pandoc.UTF8 as UTF8
111−import System.Environment (getProgName)
112111import System.Exit (exitWith, ExitCode(..))
113112import Data.Char ( toLower, isLower, isUpper, isAlpha,
114113 isLetter, isDigit, isSpace )
@@ -1002,15 +1001,13 @@ openURL u
10021001
10031002err :: Int -> String -> IO a
10041003err exitCode msg = do
1005− name <- getProgName
1006− UTF8.hPutStrLn stderr $ name ++ ": " ++ msg
1004+ UTF8.hPutStrLn stderr msg
10071005 exitWith $ ExitFailure exitCode
10081006 return undefined
10091007
10101008warn :: MonadIO m => String -> m ()
10111009warn msg = liftIO $ do
1012− name <- getProgName
1013− UTF8.hPutStrLn stderr $ "[" ++ name ++ " warning] " ++ msg
1010+ UTF8.hPutStrLn stderr $ "[warning] " ++ msg
10141011
10151012mapLeft :: (a -> b) -> Either a c -> Either b c
10161013mapLeft f (Left x) = Left (f x)