diff options
| author | John MacFarlane <[email protected]> | 2024-07-27 22:00:41 +0300 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-07-27 21:01:00 -0700 |
| commit | d2993280226697e103ea60f88e49260e0382e804 (patch) | |
| tree | 265e5f38bff3a1f93b74aa493f9d131245d501d5 /src | |
| parent | 6c43c033981dbdf7d859e7eb87962c5531e1d29a (diff) | |
Allow --number-sections to take an optional true|false argument.
This was omitted when we allowed this for other boolean flags.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/App/CommandLineOptions.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index c50ec6208..c425e2a18 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -411,8 +411,11 @@ options = "" -- "Number of levels to include in TOC" , Option "N" ["number-sections"] - (NoArg - (\opt -> return opt { optNumberSections = True })) + (OptArg + (\arg opt -> do + boolValue <- readBoolFromOptArg "--number-sections/-N" arg + return opt { optNumberSections = boolValue }) + "true|false") "" -- "Number sections" , Option "" ["number-offset"] |
