From a428c9fadc2546ed599b5d14735b4af757d12ddd Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 9 Jan 2007 01:43:23 +0000 Subject: 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 --- src/Main.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Main.hs b/src/Main.hs index 00923a5cc..0ca1e5ca5 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -396,6 +396,13 @@ main = do , optStrict = strict } = opts + if dumpArgs + then do + hPutStrLn stdout outputFile + mapM (\arg -> hPutStrLn stdout arg) args + exitWith $ ExitSuccess + else return () + let sources = if ignoreArgs then [] else args -- assign reader and writer based on options and filenames @@ -419,13 +426,6 @@ main = do then return stdout else openFile outputFile WriteMode - if dumpArgs - then do - hPutStrLn stdout outputFile - mapM (\arg -> hPutStrLn stdout arg) args - exitWith $ ExitSuccess - else return () - let tabFilter = if preserveTabs then id else (tabsToSpaces tabStop) let addBlank str = str ++ "\n\n" let removeCRs str = filter (/= '\r') str -- remove DOS-style line endings -- cgit v1.2.3