dev:ui: cleanup

This commit is contained in:
Simon Michael 2024-10-21 18:41:39 -10:00
parent 7c31ddfba2
commit 4b4cc54a6a

View File

@ -98,11 +98,12 @@ 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
defuiopts {
uoWatch = boolopt "watch" rawopts uoWatch = boolopt "watch" rawopts
,uoTheme = checkTheme <$> maybestringopt "theme" rawopts ,uoTheme = checkTheme <$> maybestringopt "theme" rawopts
,uoRegister = maybestringopt "register" rawopts ,uoRegister = maybestringopt "register" rawopts