aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-07-16 10:51:18 -0700
committerJohn MacFarlane <[email protected]>2023-07-16 10:51:18 -0700
commita5a2248df85f48e7fffe69ec5bdcc46a6b0ae4b3 (patch)
treef5fb74cac2f2351a149f0cae79cb7a8f114fe116
parent7a04fe365ada9bfcfcbb76bd9a22e70d55f230e8 (diff)
Make --epub-title-page's argument optional.
It takes a boolean argument, and now that all of our boolean flags take such an argument, we can make this one optional for consistency.
-rw-r--r--src/Text/Pandoc/App/CommandLineOptions.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs
index bc7e1b2fd..4bca19d91 100644
--- a/src/Text/Pandoc/App/CommandLineOptions.hs
+++ b/src/Text/Pandoc/App/CommandLineOptions.hs
@@ -800,14 +800,10 @@ options =
"" -- "Path of epub cover image"
, Option "" ["epub-title-page"]
- (ReqArg
- (\arg opt ->
- case arg of
- "true" -> return opt{ optEpubTitlePage = True }
- "false" -> return opt{ optEpubTitlePage = False }
- _ -> optError $ PandocOptionError $
- "Argument to --epub-title-page must be " <>
- "true or false" )
+ (OptArg
+ (\arg opt -> do
+ boolValue <- readBoolFromOptArg "--epub-title-page" arg
+ return opt{ optEpubTitlePage = boolValue })
"true|false")
""