fix: cli: ensureDebugFlagHasVal: fix multiple --debug flags not just one

This commit is contained in:
Simon Michael 2024-06-24 14:24:30 +01:00
parent 66f4091b38
commit 361b0016ff

View File

@ -577,7 +577,7 @@ replaceNumericFlags = map replace
-- This makes an equals sign unnecessary with this optional-value flag.
ensureDebugFlagHasVal :: [String] -> [String]
ensureDebugFlagHasVal as = case break (=="--debug") as of
(bs,"--debug":c:cs) | null c || not (all isDigit c) -> bs++"--debug=1":c:cs
(bs,"--debug":c:cs) | null c || not (all isDigit c) -> bs++"--debug=1" : ensureDebugFlagHasVal (c:cs)
(bs,["--debug"]) -> bs++["--debug=1"]
_ -> as