diff options
-rw-r--r-- | pandoc.cabal | 9 | ||||
-rw-r--r-- | src/markdown2pdf.hs | 10 |
2 files changed, 10 insertions, 9 deletions
diff --git a/pandoc.cabal b/pandoc.cabal index eed734423..0b2a2beb6 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -238,9 +238,8 @@ Executable markdown2pdf Ghc-Options: -Wall -threaded Ghc-Prof-Options: -auto-all Extensions: CPP, TemplateHaskell - Buildable: False --- if flag(wrappers) --- Buildable: True --- else --- Buildable: False + if flag(wrappers) + Buildable: True + else + Buildable: False diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs index dcadfb334..6a04999fa 100644 --- a/src/markdown2pdf.hs +++ b/src/markdown2pdf.hs @@ -171,17 +171,19 @@ main = bracket filter (\l -> any (`isInfixOf` l) goodoptsLong) $ lines out exitWith code -- parse arguments + -- if no input given, use 'stdin' pandocArgs <- parsePandocArgs args - (inputs, output) <- case pandocArgs of - Nothing -> exit "Could not parse arguments" + (input, output) <- case pandocArgs of + Nothing -> exit "Could not parse arguments" Just ([],out) -> do stdinFile <- saveStdin (replaceDirectory (takeBaseName out) tmp) case stdinFile of Left err -> exit err Right f -> return ([f], out) - Just (fs,out) -> return (fs, out) + -- no need because we'll pass all arguments to pandoc + Just (_ ,out) -> return ([], out) -- run pandoc - pandocRes <- runPandoc (args ++ inputs) $ replaceDirectory output tmp + pandocRes <- runPandoc (input ++ args) $ replaceDirectory output tmp case pandocRes of Left err -> exit err Right texFile -> do |