git.iko.soy/typeable/pandoc
on master help sign in
Moved up processing of --dump-args so that output file won't

be created first! git-svn-id: https://pandoc.googlecode.com/svn/trunk@465 788f1e2b-df1e-0410-8736-df70ead52e1b

commita428c9fadc2546ed599b5d14735b4af757d12ddd authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 9 Jan 2007, 01:43 (20 years ago) parent8022422
1 file changed+7−7
src/Main.hs+7−7
src/Main.hs+7−7
@@ -396,6 +396,13 @@ main = do
396396 , optStrict = strict
397397 } = opts
398398
399+ if dumpArgs
400+ then do
401+ hPutStrLn stdout outputFile
402+ mapM (\arg -> hPutStrLn stdout arg) args
403+ exitWith $ ExitSuccess
404+ else return ()
405+
399406 let sources = if ignoreArgs then [] else args
400407
401408 -- assign reader and writer based on options and filenames
@@ -419,13 +426,6 @@ main = do
419426 then return stdout
420427 else openFile outputFile WriteMode
421428
422− if dumpArgs
423− then do
424− hPutStrLn stdout outputFile
425− mapM (\arg -> hPutStrLn stdout arg) args
426− exitWith $ ExitSuccess
427− else return ()
428−
429429 let tabFilter = if preserveTabs then id else (tabsToSpaces tabStop)
430430 let addBlank str = str ++ "\n\n"
431431 let removeCRs str = filter (/= '\r') str -- remove DOS-style line endings