From 34d94c2d2ed01055184f0f4f5a4c4df430e47fb4 Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Fri, 10 Apr 2020 23:34:26 +0200 Subject: [PATCH] Fix buggy handling of defaults on CmdParserPart --- src/UI/Butcher/Monadic/Internal/Core.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/UI/Butcher/Monadic/Internal/Core.hs b/src/UI/Butcher/Monadic/Internal/Core.hs index 82c629d..1fca031 100644 --- a/src/UI/Butcher/Monadic/Internal/Core.hs +++ b/src/UI/Butcher/Monadic/Internal/Core.hs @@ -625,6 +625,10 @@ runCmdParserAExt mTopLevel inputInitial cmdParser = mSet $ InputArgs strr actRest <- processMain $ nextF x return $ actF x *> actRest + Just (x, rest) | str == rest -> do + -- no input consumed, default applied + actRest <- processMain $ nextF x + return $ actF x *> actRest _ -> do mTell ["could not parse " ++ getPartSeqDescPositionName desc] processMain $ nextF monadMisuseError