A bit of refactoring that shouldn't change any semantics.
In preparation for a fix to #1267.
This commit is contained in:
parent
f81fc6c3bd
commit
f80678df7f
1 changed files with 8 additions and 9 deletions
17
pandoc.hs
17
pandoc.hs
|
@ -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"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue