From 5e1c4223899cb24ecf5f4ad1fd26c3ac22841e77 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 15 Oct 2017 18:27:48 -0700 Subject: Handle unknown options in form `--latex-engine=foo`. Previously these were not triggering the helpful message about option name changes. --- src/Text/Pandoc/App.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 6b64a314e..46696c425 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -110,7 +110,8 @@ parseOptions options' defaults = do let (actions, args, unrecognizedOpts, errors) = getOpt' Permute options' rawArgs - let unknownOptionErrors = foldr handleUnrecognizedOption [] unrecognizedOpts + let unknownOptionErrors = foldr handleUnrecognizedOption [] $ + map (takeWhile (/= '=')) unrecognizedOpts unless (null errors && null unknownOptionErrors) $ E.throwIO $ PandocOptionError $ -- cgit v1.2.3