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
11
pandoc.hs
11
pandoc.hs
|
@ -243,13 +243,13 @@ options :: [OptDescr (Opt -> IO Opt)]
|
|||
options =
|
||||
[ Option "fr" ["from","read"]
|
||||
(ReqArg
|
||||
(\arg opt -> return opt { optReader = map toLower arg })
|
||||
(\arg opt -> return opt { optReader = arg })
|
||||
"FORMAT")
|
||||
""
|
||||
|
||||
, Option "tw" ["to","write"]
|
||||
(ReqArg
|
||||
(\arg opt -> return opt { optWriter = map toLower arg })
|
||||
(\arg opt -> return opt { optWriter = arg })
|
||||
"FORMAT")
|
||||
""
|
||||
|
||||
|
@ -1008,11 +1008,10 @@ main = do
|
|||
then "html"
|
||||
else "markdown"
|
||||
in defaultReaderName fallback sources
|
||||
else readerName
|
||||
else map toLower readerName
|
||||
|
||||
let writerName' = if null writerName
|
||||
then defaultWriterName outputFile
|
||||
else case writerName of
|
||||
let writerName' = case map toLower writerName of
|
||||
[] -> defaultWriterName outputFile
|
||||
"epub2" -> "epub"
|
||||
"html4" -> "html"
|
||||
x -> x
|
||||
|
|
Loading…
Reference in a new issue