diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-11-14 18:42:55 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-11-14 18:42:55 -0800 |
commit | 81fae63a5429266fd04c25a8da8fa442eee8c788 (patch) | |
tree | f730f86c21f6dae823b7eb37ef8383dcd5cfa064 /src/Text/Pandoc/App/CommandLineOptions.hs | |
parent | 871bfaf794f132133e35641e55619991253221f2 (diff) | |
download | pandoc-81fae63a5429266fd04c25a8da8fa442eee8c788.tar.gz |
Change optInputFiles to a `Maybe [FilePath]`.
`Nothing` means: nothing specified.
`Just []` means: an empty list specified (e.g. in defaults).
Potentially these could lead to different behavior: see #5888.
Diffstat (limited to 'src/Text/Pandoc/App/CommandLineOptions.hs')
-rw-r--r-- | src/Text/Pandoc/App/CommandLineOptions.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index 56b1f780a..1776107ff 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -85,7 +85,11 @@ parseOptions options' defaults = do -- thread option data structure through all supplied option actions opts <- foldl (>>=) (return defaults) actions - return (opts{ optInputFiles = map normalizePath $ optInputFiles opts ++ args }) + let mbArgs = case args of + [] -> Nothing + xs -> Just xs + return $ opts{ optInputFiles = + map normalizePath <$> (optInputFiles opts <> mbArgs) } latexEngines :: [String] latexEngines = ["pdflatex", "lualatex", "xelatex", "latexmk", "tectonic"] |