imp: setup: improve output

This commit is contained in:
Simon Michael 2025-04-25 15:21:59 -10:00
parent f0f048326e
commit 144489a418

View File

@ -333,7 +333,6 @@ setupJournal meconf = do
pdesc "a default journal file is readable ?" pdesc "a default journal file is readable ?"
jfile <- defaultJournalPath jfile <- defaultJournalPath
-- let -- let
-- args = concat [ -- args = concat [
-- ["print"], -- ["print"],
@ -344,7 +343,7 @@ setupJournal meconf = do
-- XXX can this ignore assertions and config files, like the above ? -- XXX can this ignore assertions and config files, like the above ?
ej <- defaultJournalSafely ej <- defaultJournalSafely
case ej of case ej of
Left e -> p N (jfile <> ":\n" <> show e) Left estr -> p N (jfile <> ":\n" <> estr)
Right j@Journal{..} -> do Right j@Journal{..} -> do
p Y jfile p Y jfile
@ -418,25 +417,18 @@ setupJournal meconf = do
then p Y (concatMap show accttypes) then p Y (concatMap show accttypes)
else p N (concatMap show typesnotfound <> "not found; type: queries, bs/cf/is reports may not work") else p N (concatMap show typesnotfound <> "not found; type: queries, bs/cf/is reports may not work")
pdesc "balance assertions are checked ?"
let
ignoreassertions = isJust $ conflookup (\a -> any (==a) ["-I", "--ignore-assertions"])
strict = isJust $ conflookup (\a -> any (==a) ["-s", "--strict"])
if
| ignoreassertions && not strict -> i N "use -s to check assertions"
| not strict -> i Y "use -I to ignore assertions"
| otherwise -> i Y "can't ignore assertions (-s in config file)"
pdesc "commodities/accounts are checked ?" pdesc "commodities/accounts are checked ?"
let strict = isJust $ conflookup (\a -> any (==a) ["-s", "--strict"])
if strict if strict
then i Y "commodities and accounts must be declared" then i Y "commodities and accounts must be declared"
else i N "use -s to check commodities/accounts" else i N "use -s to check commodities/accounts"
------------------------------------------------------------------------------ pdesc "balance assertions are checked ?"
let ignoreassertions = isJust $ conflookup (\a -> any (==a) ["-I", "--ignore-assertions"])
-- setupX = do if
-- pgroup "x" | ignoreassertions && not strict -> i N "use -s to check assertions"
-- pdesc "x ?" | not strict -> i Y "use -I to ignore assertions"
| otherwise -> i Y "can't ignore assertions (-s in config file)"
------------------------------------------------------------------------------ ------------------------------------------------------------------------------