aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2014-06-25 14:09:01 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2014-06-25 14:09:01 -0400
commitaa194d387c103d001fc911f37d4cfc26be98d93c (patch)
tree628fa041615600e720cbc015a80d2173d70c6a3d
parentd824f89fb3996fd27e156da1141808fbf468819d (diff)
downloadpandoc-aa194d387c103d001fc911f37d4cfc26be98d93c.tar.gz
Add track changes option to command line.
-rw-r--r--pandoc.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 10673132b..588723322 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -174,6 +174,7 @@ data Opt = Opt
, optTeXLigatures :: Bool -- ^ Use TeX ligatures for quotes/dashes
, optDefaultImageExtension :: String -- ^ Default image extension
, optTrace :: Bool -- ^ Print debug information
+ , optTrackChanges :: TrackChanges -- ^ Accept or reject MS Word track-changes.
}
-- | Defaults for command-line options.
@@ -230,6 +231,7 @@ defaultOpts = Opt
, optTeXLigatures = True
, optDefaultImageExtension = ""
, optTrace = False
+ , optTrackChanges = AcceptChanges
}
-- | A list of functions, each transforming the options data structure
@@ -776,6 +778,19 @@ options =
(\opt -> return opt { optTrace = True }))
"" -- "Turn on diagnostic tracing in readers."
+ , Option "" ["track-changes"]
+ (ReqArg
+ (\arg opt -> do
+ action <- case arg of
+ "accept" -> return AcceptChanges
+ "reject" -> return RejectChanges
+ "all" -> return AllChanges
+ _ -> err 6
+ ("Unknown option for track-changes: " ++ arg)
+ return opt { optTrackChanges = action })
+ "accept|reject|all")
+ "" -- "Accepting or reject MS Word track-changes.""
+
, Option "" ["dump-args"]
(NoArg
(\opt -> return opt { optDumpArgs = True }))
@@ -973,6 +988,7 @@ main = do
, optTeXLigatures = texLigatures
, optDefaultImageExtension = defaultImageExtension
, optTrace = trace
+ , optTrackChanges = trackChanges
} = opts
when dumpArgs $
@@ -1097,6 +1113,7 @@ main = do
, readerApplyMacros = not laTeXOutput
, readerDefaultImageExtension = defaultImageExtension
, readerTrace = trace
+ , readerTrackChanges = trackChanges
}
let writerOptions = def { writerStandalone = standalone',