Allow --list-extensions
to take an optional FORMAT argument.
This lists the extensions set by default for the selected FORMAT.
This commit is contained in:
parent
ab9b9cf95b
commit
cc9e3a9172
2 changed files with 9 additions and 7 deletions
|
@ -387,11 +387,11 @@ General options
|
||||||
|
|
||||||
: List supported output formats, one per line.
|
: List supported output formats, one per line.
|
||||||
|
|
||||||
`--list-extensions`
|
`--list-extensions`[`=`*FORMAT*]
|
||||||
|
|
||||||
: List supported Markdown extensions, one per line, followed
|
: List supported Markdown extensions, one per line, followed
|
||||||
by a `+` or `-` indicating whether it is enabled by default
|
by a `+` or `-` indicating whether it is enabled by default
|
||||||
in pandoc's Markdown.
|
in *FORMAT* (defaulting to pandoc's Markdown).
|
||||||
|
|
||||||
`--list-highlight-languages`
|
`--list-highlight-languages`
|
||||||
|
|
||||||
|
|
|
@ -1589,15 +1589,17 @@ options =
|
||||||
""
|
""
|
||||||
|
|
||||||
, Option "" ["list-extensions"]
|
, Option "" ["list-extensions"]
|
||||||
(NoArg
|
(OptArg
|
||||||
(\_ -> do
|
(\arg _ -> do
|
||||||
|
let exts = getDefaultExtensions (fromMaybe "markdown" arg)
|
||||||
let showExt x = drop 4 (show x) ++
|
let showExt x = drop 4 (show x) ++
|
||||||
if extensionEnabled x pandocExtensions
|
if extensionEnabled x exts
|
||||||
then " +"
|
then " +"
|
||||||
else " -"
|
else " -"
|
||||||
mapM_ (UTF8.hPutStrLn stdout . showExt)
|
mapM_ (UTF8.hPutStrLn stdout . showExt)
|
||||||
([minBound..maxBound] :: [Extension])
|
([minBound..maxBound] :: [Extension])
|
||||||
exitSuccess ))
|
exitSuccess )
|
||||||
|
"FORMAT")
|
||||||
""
|
""
|
||||||
|
|
||||||
, Option "" ["list-highlight-languages"]
|
, Option "" ["list-highlight-languages"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue