From cc9e3a91724dff0b962d23a58c1188d60dee07dd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 27 Dec 2017 12:25:48 -0800 Subject: Allow `--list-extensions` to take an optional FORMAT argument. This lists the extensions set by default for the selected FORMAT. --- src/Text/Pandoc/App.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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"] -- cgit v1.2.3