summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-27 12:25:48 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-27 12:25:48 -0800
commitcc9e3a91724dff0b962d23a58c1188d60dee07dd (patch)
treee334386eea44d728d05709ceb9432b83ce651d94 /src
parentab9b9cf95bb86dbbad42e2c4de589ddd6ae2e8ec (diff)
Allow `--list-extensions` to take an optional FORMAT argument.
This lists the extensions set by default for the selected FORMAT.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index 641d3782b..50464830b 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -1589,15 +1589,17 @@ options =
""
, Option "" ["list-extensions"]
- (NoArg
- (\_ -> do
+ (OptArg
+ (\arg _ -> do
+ let exts = getDefaultExtensions (fromMaybe "markdown" arg)
let showExt x = drop 4 (show x) ++
- if extensionEnabled x pandocExtensions
+ if extensionEnabled x exts
then " +"
else " -"
mapM_ (UTF8.hPutStrLn stdout . showExt)
([minBound..maxBound] :: [Extension])
- exitSuccess ))
+ exitSuccess )
+ "FORMAT")
""
, Option "" ["list-highlight-languages"]