Text.Pandoc.App.Opt: Change optShiftHeadingLevel to optShiftHeadingLevelBy...

to match the option.
This commit is contained in:
John MacFarlane 2019-10-06 16:53:59 -07:00
parent ceeb565203
commit cf1703396c
3 changed files with 4 additions and 4 deletions

View file

@ -232,7 +232,7 @@ convertWithOpts opts = do
let transforms = (case optBaseHeaderLevel opts of
x | x > 1 -> (headerShift (x - 1) :)
| otherwise -> id) .
(case optShiftHeadingLevel opts of
(case optShiftHeadingLevelBy opts of
0 -> id
x -> (headerShift x :)) .
(if optStripEmptyParagraphs opts

View file

@ -441,7 +441,7 @@ options =
(\arg opt ->
case safeRead arg of
Just t ->
return opt{ optShiftHeadingLevel = t }
return opt{ optShiftHeadingLevelBy = t }
_ -> E.throwIO $ PandocOptionError
"shift-heading-level-by takes an integer argument")
"NUMBER")

View file

@ -50,7 +50,7 @@ data Opt = Opt
, optReader :: Maybe String -- ^ Reader format
, optWriter :: Maybe String -- ^ Writer format
, optTableOfContents :: Bool -- ^ Include table of contents
, optShiftHeadingLevel :: Int -- ^ Shift heading level by
, optShiftHeadingLevelBy :: Int -- ^ Shift heading level by
, optBaseHeaderLevel :: Int -- ^ Base header level
, optTemplate :: Maybe FilePath -- ^ Custom template
, optVariables :: [(String,String)] -- ^ Template variables to set
@ -125,7 +125,7 @@ defaultOpts = Opt
, optReader = Nothing
, optWriter = Nothing
, optTableOfContents = False
, optShiftHeadingLevel = 0
, optShiftHeadingLevelBy = 0
, optBaseHeaderLevel = 1
, optTemplate = Nothing
, optVariables = []