aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-11-06 09:06:49 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-06 09:06:49 -0800
commitadad3c70b6d68563f2dad5136705fcaa33d719ea (patch)
treee1fda2ace711cf8e76369df68727a34b4679df23 /src/Text
parent803ab48a2082a4fbc835e481bd122123a7276199 (diff)
downloadpandoc-adad3c70b6d68563f2dad5136705fcaa33d719ea.tar.gz
Allow singular input-file in defaults file.
Closes #5877.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/App/Opt.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index a93b2a212..6db397147 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -194,6 +194,10 @@ doOpt (k',v) = do
parseYAML v >>= \x -> return (\o -> o{ optOutputFile = unpack <$> x })
"input-files" ->
parseYAML v >>= \x -> return (\o -> o{ optInputFiles = map unpack x })
+ "input-file" -> -- allow either a list or a single value
+ (parseYAML v >>= \x -> return (\o -> o{ optInputFiles = map unpack x }))
+ <|>
+ (parseYAML v >>= \x -> return (\o -> o{ optInputFiles = [unpack x] }))
"number-sections" ->
parseYAML v >>= \x -> return (\o -> o{ optNumberSections = x })
"number-offset" ->