diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-12-27 12:25:48 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-12-27 12:25:48 -0800 |
commit | cc9e3a91724dff0b962d23a58c1188d60dee07dd (patch) | |
tree | e334386eea44d728d05709ceb9432b83ce651d94 /src/Text | |
parent | ab9b9cf95bb86dbbad42e2c4de589ddd6ae2e8ec (diff) | |
download | pandoc-cc9e3a91724dff0b962d23a58c1188d60dee07dd.tar.gz |
Allow `--list-extensions` to take an optional FORMAT argument.
This lists the extensions set by default for the selected
FORMAT.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/App.hs | 10 |
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"] |