dev:ui: cleanup
This commit is contained in:
parent
7c31ddfba2
commit
4b4cc54a6a
@ -98,16 +98,17 @@ defuiopts = UIOpts
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- | Process a RawOpts into a UIOpts.
|
-- | Process a RawOpts into a UIOpts.
|
||||||
-- This will return a usage error if provided an invalid theme.
|
-- An invalid --theme name will raise an error.
|
||||||
rawOptsToUIOpts :: RawOpts -> IO UIOpts
|
rawOptsToUIOpts :: RawOpts -> IO UIOpts
|
||||||
rawOptsToUIOpts rawopts = do
|
rawOptsToUIOpts rawopts = do
|
||||||
cliopts <- set balanceaccum accum <$> rawOptsToCliOpts rawopts
|
cliopts <- set balanceaccum accum <$> rawOptsToCliOpts rawopts
|
||||||
return defuiopts {
|
return
|
||||||
uoWatch = boolopt "watch" rawopts
|
defuiopts {
|
||||||
,uoTheme = checkTheme <$> maybestringopt "theme" rawopts
|
uoWatch = boolopt "watch" rawopts
|
||||||
,uoRegister = maybestringopt "register" rawopts
|
,uoTheme = checkTheme <$> maybestringopt "theme" rawopts
|
||||||
,uoCliOpts = cliopts
|
,uoRegister = maybestringopt "register" rawopts
|
||||||
}
|
,uoCliOpts = cliopts
|
||||||
|
}
|
||||||
where
|
where
|
||||||
-- show historical balance by default (unlike hledger)
|
-- show historical balance by default (unlike hledger)
|
||||||
accum = fromMaybe Historical $ balanceAccumulationOverride rawopts
|
accum = fromMaybe Historical $ balanceAccumulationOverride rawopts
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user