diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/markdown2pdf.hs | 5 | ||||
-rw-r--r-- | src/pandoc.hs | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs index 7bcbf4a82..ea580da98 100644 --- a/src/markdown2pdf.hs +++ b/src/markdown2pdf.hs @@ -152,13 +152,14 @@ main = bracket unless (null miss) $ exit $! "Could not find " ++ intercalate ", " miss args <- getArgs -- check for invalid arguments and print help message if needed - let goodopts = ["-f","-r","-N", "-p","-R","-H","-B","-A", "-C","-o"] + let goodopts = ["-f","-r","-N", "-p","-R","-H","-B","-A", "-C","-o","-V"] let goodoptslong = ["--from","--read","--strict", "--preserve-tabs","--tab-stop","--parse-raw", "--toc","--table-of-contents", "--number-sections","--include-in-header", "--include-before-body","--include-after-body", - "--custom-header","--output"] + "--custom-header","--output", + "--template", "--variable"] let isOpt ('-':_) = True isOpt _ = False let opts = filter isOpt args diff --git a/src/pandoc.hs b/src/pandoc.hs index b595f7e50..3e9964130 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -339,6 +339,19 @@ options = "FILENAME") "" -- "Use custom template" + , Option "V" ["variable"] + (ReqArg + (\arg opt -> + case break (`elem` ":=") arg of + (k,_:v) -> do + let newvars = (k, v) : optVariables opt + return opt{ optVariables = newvars } + _ -> do + hPutStrLn stderr $ "Could not parse `" ++ arg ++ "' as a key/value pair (k=v or k:v)" + exitWith $ ExitFailure 17) + "FILENAME") + "" -- "Use custom template" + , Option "c" ["css"] (ReqArg (\arg opt -> do |