A bit of refactoring that shouldn't change any semantics.

In preparation for a fix to #1267.
This commit is contained in:
John MacFarlane 2014-04-27 20:38:15 -07:00
parent f81fc6c3bd
commit f80678df7f

View file

@ -243,13 +243,13 @@ options :: [OptDescr (Opt -> IO Opt)]
options = options =
[ Option "fr" ["from","read"] [ Option "fr" ["from","read"]
(ReqArg (ReqArg
(\arg opt -> return opt { optReader = map toLower arg }) (\arg opt -> return opt { optReader = arg })
"FORMAT") "FORMAT")
"" ""
, Option "tw" ["to","write"] , Option "tw" ["to","write"]
(ReqArg (ReqArg
(\arg opt -> return opt { optWriter = map toLower arg }) (\arg opt -> return opt { optWriter = arg })
"FORMAT") "FORMAT")
"" ""
@ -1008,14 +1008,13 @@ main = do
then "html" then "html"
else "markdown" else "markdown"
in defaultReaderName fallback sources in defaultReaderName fallback sources
else readerName else map toLower readerName
let writerName' = if null writerName let writerName' = case map toLower writerName of
then defaultWriterName outputFile [] -> defaultWriterName outputFile
else case writerName of "epub2" -> "epub"
"epub2" -> "epub" "html4" -> "html"
"html4" -> "html" x -> x
x -> x
let pdfOutput = map toLower (takeExtension outputFile) == ".pdf" let pdfOutput = map toLower (takeExtension outputFile) == ".pdf"