git.iko.soy/typeable/pandoc
on master help sign in
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.

commitbfa6c0b57df299e7d574e65b9b04f65456dfdf28 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 14 Nov 2019, 21:46 (7 years ago) parent81fae63
2 files changed+5−4
MANUAL.txt+1−1 src/Text/Pandoc/App/Opt.hs+4−3
MANUAL.txt+1−1
@@ -1433,7 +1433,7 @@ to: html5
14331433
14341434# leave blank for output to stdout:
14351435output-file:
1436−# leave blank for input from stdin:
1436+# leave blank for input from stdin, use [] for no input:
14371437input-files:
14381438- preface.md
14391439- content.md
src/Text/Pandoc/App/Opt.hs+4−3
@@ -202,15 +202,16 @@ doOpt (k',v) = do
202202 "input-files" ->
203203 parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
204204 optInputFiles o <>
205− Just (map unpack x) })
205+ (map unpack <$> x) })
206206 "input-file" -> -- allow either a list or a single value
207207 (parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
208208 optInputFiles o <>
209− Just (map unpack x) }))
209+ (map unpack <$> x) }))
210210 <|>
211211 (parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
212212 optInputFiles o <>
213− Just [unpack x] }))
213+ ((\z -> [unpack z]) <$> x)
214+ }))
214215 "number-sections" ->
215216 parseYAML v >>= \x -> return (\o -> o{ optNumberSections = x })
216217 "number-offset" ->