@@ -112,8 +112,9 @@ parseOptions options' defaults = do
112112 let (actions, args, unrecognizedOpts, errors) =
113113 getOpt' Permute options' rawArgs
114114
115− let unknownOptionErrors = foldr handleUnrecognizedOption [] $
116− map (takeWhile (/= '=')) unrecognizedOpts
115+ let unknownOptionErrors =
116+ foldr (handleUnrecognizedOption . (takeWhile (/= '='))) []
117+ unrecognizedOpts
117118
118119 unless (null errors && null unknownOptionErrors) $
119120 E.throwIO $ PandocOptionError $
@@ -205,12 +206,10 @@ convertWithOpts opts = do
205206 Just _ -> return $ optDataDir opts
206207
207208 -- assign reader and writer based on options and filenames
208− let readerName = case optReader opts of
209− Nothing -> defaultReaderName
210− (if any isURI sources
211− then "html"
212− else "markdown") sources
213− Just x -> x
209+ let readerName = fromMaybe ( defaultReaderName
210+ (if any isURI sources
211+ then "html"
212+ else "markdown") sources) (optReader opts)
214213
215214 let nonPdfWriterName Nothing = defaultWriterName outputFile
216215 nonPdfWriterName (Just x) = x
@@ -286,7 +285,7 @@ convertWithOpts opts = do
286285#else
287286 istty <- queryTerminal stdOutput
288287#endif
289− when (not (isTextFormat format) && istty && optOutputFile opts == Nothing) $
288+ when (not (isTextFormat format) && istty && isNothing ( optOutputFile opts)) $
290289 E.throwIO $ PandocAppError $
291290 "Cannot write " ++ format ++ " output to terminal.\n" ++
292291 "Specify an output file using the -o option, or " ++