summaryrefslogtreecommitdiff
path: root/src/markdown2pdf.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-06-25 01:12:07 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-06-25 01:12:07 +0000
commit15258f66f082879a4c49f0130ed05cac32074a1b (patch)
tree45a004c2cfbea34675bbfa05b6db4e8268503c39 /src/markdown2pdf.hs
parent541a032e49d503f703b83c4348f5c3e6721b26c3 (diff)
Fixed duplicate text bug in markdown2pdf.hs. (Paulo Tanimoto)
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1582 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/markdown2pdf.hs')
-rw-r--r--src/markdown2pdf.hs10
1 files changed, 6 insertions, 4 deletions
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