Have pandoc return exit code 2 whenever a usage message is

produced, even if it's because a bad option was specified.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@455 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher
2007-01-08 16:29:29 +00:00
parent 5dda65b5dc
commit 9eafa97156
+3 -3
View File
@@ -48,8 +48,8 @@ import Text.Pandoc.Writers.DefaultHeaders ( defaultHtmlHeader,
import Text.Pandoc.Definition
import Text.Pandoc.Shared
import Text.Regex ( mkRegex, matchRegex )
import System ( exitWith, getArgs, getProgName )
import System.Exit
import System.Environment ( getArgs, getProgName )
import System.Exit ( exitWith, ExitCode (..) )
import System.Console.GetOpt
import System.IO
import Data.Maybe ( fromMaybe )
@@ -361,7 +361,7 @@ main = do
name <- getProgName
mapM (\e -> hPutStrLn stderr e) errors
hPutStr stderr (usageMessage name options)
exitWith $ ExitFailure 3
exitWith $ ExitFailure 2
else
return ()