Fix two bugs

- when input was missing inside a reorder, butcher
  erroneously reported an monadMisuseError;
- flags that allow multiple occurences/values returned
  the results in the reversed order.
pull/5/head
Lennart Spitzner 2017-05-16 23:44:54 +02:00
parent 719d447701
commit 97f7165656
1 changed files with 2 additions and 3 deletions

View File

@ -880,8 +880,7 @@ runCmdParserAExt mTopLevel inputInitial cmdParser
++ show input
]
failureCurrentShallowRerun
return $ return $ monadMisuseError -- so ugly.
-- should be correct nonetheless.
processParsedParts $ nextF monadMisuseError
continueOrMisuse :: Maybe p -> m (CmdParser f out a)
continueOrMisuse = maybe monadMisuseError
(processParsedParts . nextF)
@ -916,7 +915,7 @@ runCmdParserAExt mTopLevel inputInitial cmdParser
mSet $ MapS.delete pid m
let partDyns = case MapS.lookup pid m of
Nothing -> []
Just r -> r
Just r -> reverse r
case mapM fromDynamic partDyns of
Nothing -> monadMisuseError
Just xs -> processParsedParts $ nextF xs