Skip to content

Commit

Permalink
Produce error if --csl is used more than once (#8252)
Browse files Browse the repository at this point in the history
Closes #8195.

Co-authored-by: Prat T <pt2121@users.noreply.github.com>
  • Loading branch information
pt2121 and pt2121 authored Aug 30, 2022
1 parent 9b6220c commit 06c3928
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Text/Pandoc/App/CommandLineOptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,11 @@ options =

, Option "" ["csl"]
(ReqArg
(\arg opt ->
return opt{ optMetadata =
addMeta "csl" (normalizePath arg) $
optMetadata opt })
(\arg opt -> do
case lookupMeta (T.pack "csl") $ optMetadata opt of
Just _ -> E.throwIO $ PandocOptionError "Only one CSL file can be specified."
Nothing -> return opt{ optMetadata = addMeta "csl" (normalizePath arg) $
optMetadata opt })
"FILE")
""

Expand Down

0 comments on commit 06c3928

Please sign in to comment.