aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-09 01:43:23 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-09 01:43:23 +0000
commita428c9fadc2546ed599b5d14735b4af757d12ddd (patch)
tree449f07d323ca85175fa1222145425bf69b218fe4 /src
parent80224229fc3c481feaa86231698ad5b3c159a712 (diff)
downloadpandoc-a428c9fadc2546ed599b5d14735b4af757d12ddd.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs14
1 files changed, 7 insertions, 7 deletions
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