aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App/Opt.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-11-14 21:46:35 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-14 21:46:35 -0800
commitbfa6c0b57df299e7d574e65b9b04f65456dfdf28 (patch)
tree71ff7e837d5b4078cde54f29a1b9f9ec853838ce /src/Text/Pandoc/App/Opt.hs
parent81fae63a5429266fd04c25a8da8fa442eee8c788 (diff)
downloadpandoc-bfa6c0b57df299e7d574e65b9b04f65456dfdf28.tar.gz
Default files: Allow leaving input-files blank again.
Leaving it blank yields a Nothing value (interpreted as stdin). Providing an empty list is intepreted as no input. This resolves one part of #5888.
Diffstat (limited to 'src/Text/Pandoc/App/Opt.hs')
-rw-r--r--src/Text/Pandoc/App/Opt.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index ed167fff2..09f018233 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -202,15 +202,16 @@ doOpt (k',v) = do
"input-files" ->
parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
optInputFiles o <>
- Just (map unpack x) })
+ (map unpack <$> x) })
"input-file" -> -- allow either a list or a single value
(parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
optInputFiles o <>
- Just (map unpack x) }))
+ (map unpack <$> x) }))
<|>
(parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
optInputFiles o <>
- Just [unpack x] }))
+ ((\z -> [unpack z]) <$> x)
+ }))
"number-sections" ->
parseYAML v >>= \x -> return (\o -> o{ optNumberSections = x })
"number-offset" ->