From a5a2248df85f48e7fffe69ec5bdcc46a6b0ae4b3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 16 Jul 2023 10:51:18 -0700 Subject: 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. --- src/Text/Pandoc/App/CommandLineOptions.hs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src') 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") "" -- cgit v1.2.3