summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-12-03 23:12:09 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:40 +0100
commit7bf0813814eb3df65ba2190ecd9555df2ae251ae (patch)
treeb8b0b84ae218b7ba9b4e7f7d5897f08c68e73066 /src/Text/Pandoc
parentc55a98ff0d3856221d9f4f93229ecea5a663fe42 (diff)
Shared: changed err and warn output.
Don't print program name in either case. Print [warning] for warnings.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Shared.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index bd2da945e..4420199f2 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -108,7 +108,6 @@ import Text.Pandoc.MediaBag (MediaBag, lookupMedia)
import Text.Pandoc.Builder (Inlines, Blocks, ToMetaValue(..))
import qualified Text.Pandoc.Builder as B
import qualified Text.Pandoc.UTF8 as UTF8
-import System.Environment (getProgName)
import System.Exit (exitWith, ExitCode(..))
import Data.Char ( toLower, isLower, isUpper, isAlpha,
isLetter, isDigit, isSpace )
@@ -1002,15 +1001,13 @@ openURL u
err :: Int -> String -> IO a
err exitCode msg = do
- name <- getProgName
- UTF8.hPutStrLn stderr $ name ++ ": " ++ msg
+ UTF8.hPutStrLn stderr msg
exitWith $ ExitFailure exitCode
return undefined
warn :: MonadIO m => String -> m ()
warn msg = liftIO $ do
- name <- getProgName
- UTF8.hPutStrLn stderr $ "[" ++ name ++ " warning] " ++ msg
+ UTF8.hPutStrLn stderr $ "[warning] " ++ msg
mapLeft :: (a -> b) -> Either a c -> Either b c
mapLeft f (Left x) = Left (f x)