lib: Hledger.Data.RawOptions: add unsetboolopt

This commit is contained in:
Simon Michael 2023-01-05 18:02:47 -10:00
parent d98dfedb9e
commit 7408bc02df

View File

@ -11,6 +11,7 @@ module Hledger.Data.RawOptions (
RawOpts,
setopt,
setboolopt,
unsetboolopt,
appendopts,
inRawOpts,
boolopt,
@ -49,6 +50,9 @@ setopt name val = overRawOpts (++ [(name, val)])
setboolopt :: String -> RawOpts -> RawOpts
setboolopt name = overRawOpts (++ [(name,"")])
unsetboolopt :: String -> RawOpts -> RawOpts
unsetboolopt name = overRawOpts (filter ((/=name).fst))
appendopts :: [(String,String)] -> RawOpts -> RawOpts
appendopts new = overRawOpts (++new)