imp:areg: keep no matched account error on one line

This commit is contained in:
Simon Michael 2025-12-07 16:51:26 -10:00
parent 6bdaef89c0
commit 28f2180649

View File

@ -89,7 +89,7 @@ aregister opts@CliOpts{rawopts_=rawopts,reportspec_=rspec} j = do
(a:as) -> return (a, map T.pack as)
let
-- keep synced with findMatchedByArgument's matching
acct = fromMaybe (error' $ help <> ",\nbut " ++ show apat++" did not match any account.") -- PARTIAL:
acct = fromMaybe (error' $ help <> ", but " ++ show apat++" did not match any account.") -- PARTIAL:
. firstMatch $ journalAccountNamesDeclaredOrImplied j
firstMatch = case toRegexCI $ T.pack apat of
Right re -> find (regexMatchText re)