diff --git a/MANUAL.txt b/MANUAL.txt index 74577d727fd7..393ae8f8c0fd 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1082,7 +1082,7 @@ header when requesting a document from a URL: headings to become `\part{..}`, while second-level headings remain as their default type. -`-N`, `--number-sections` +`-N`, `--number-sections=[true|false]` : Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB output. By default, sections are not numbered. Sections with class diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index c50ec6208298..c425e2a18f98 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"]