From d9bc45b5230ba16fbfc523f48caaaf7d33a32329 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 20 Sep 2025 05:53:04 -0700 Subject: [PATCH] imp:accounts: --types shows a tag only when type is known --- hledger/Hledger/Cli/Commands/Accounts.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hledger/Hledger/Cli/Commands/Accounts.hs b/hledger/Hledger/Cli/Commands/Accounts.hs index 3e97a93f4..1449b6998 100644 --- a/hledger/Hledger/Cli/Commands/Accounts.hs +++ b/hledger/Hledger/Cli/Commands/Accounts.hs @@ -124,9 +124,10 @@ accounts opts@CliOpts{rawopts_=rawopts, reportspec_=ReportSpec{_rsQuery=query,_r where indent = T.replicate (2 * (max 0 (accountNameLevel a - drop_ ropts) - 1)) " " droppedName = accountNameDrop (drop_ ropts) a - showType a - | types = pad a <> " ; type: " <> maybe "" (T.pack . show) (journalAccountType j a) - | otherwise = "" + showType a = + case (types, journalAccountType j a) of + (True, Just t) -> pad a <> " ; type: " <> T.pack (show t) + _ -> "" showAcctDeclOrder a | positions = (if types then "," else pad a <> " ;") <>