From 907077709186381e655ede4685efc5af9fbd871d Mon Sep 17 00:00:00 2001
From: fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
Date: Sat, 2 Jan 2010 18:19:28 +0000
Subject: [PATCH] markdown2pdf.hs: throw error if pandoc --dump-args does.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1781 788f1e2b-df1e-0410-8736-df70ead52e1b
---
 src/markdown2pdf.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs
index 769139508..0333b121f 100644
--- a/src/markdown2pdf.hs
+++ b/src/markdown2pdf.hs
@@ -34,7 +34,7 @@ run file opts = do
 parsePandocArgs :: [String] -> IO (Maybe ([String], String))
 parsePandocArgs args = do
   result <- run "pandoc" $ ["--dump-args"] ++ args
-  return $ either (const Nothing) (parse . map trim . lines) result
+  return $ either error (parse . map trim . lines) result
   where parse []         = Nothing
         parse ("-":[])   = Just ([], "stdin") -- no output or input
         parse ("-":x:xs) = Just (x:xs, dropExtension x) -- no output
@@ -43,11 +43,11 @@ parsePandocArgs args = do
         trim = takeWhile (/='\r') . dropWhile (=='\r')
 
 runPandoc :: [String] -> FilePath -> IO (Either String FilePath)
-runPandoc inputs output = do
+runPandoc inputsAndArgs output = do
   let texFile = replaceExtension output "tex"
   result <- run "pandoc" $
     ["-s", "--no-wrap", "-r", "markdown", "-w", "latex"]
-    ++ inputs ++ ["-o", texFile]
+    ++ inputsAndArgs ++ ["-o", texFile]
   return $ either Left (const $ Right texFile) result
 
 runLatexRaw :: String -> FilePath -> IO (Either (Either String String) FilePath)