diff --git a/Ledger/Ledger.hs b/Ledger/Ledger.hs index 358f5c6d9..1fccd7ee8 100644 --- a/Ledger/Ledger.hs +++ b/Ledger/Ledger.hs @@ -18,7 +18,7 @@ ledgerAccountTree, addDataToAccountNameTree, printentries, printregister, -showLedgerAccounts, +showLedgerAccountBalances, showAccountTree, isBoringInnerAccount, isBoringInnerAccountName, @@ -218,8 +218,8 @@ e g @ -} -showLedgerAccounts :: Ledger -> Int -> String -showLedgerAccounts l maxdepth = +showLedgerAccountBalances :: Ledger -> Int -> String +showLedgerAccountBalances l maxdepth = concatMap (showAccountTree l) (branches $ ledgerAccountTree l maxdepth) diff --git a/Tests.hs b/Tests.hs index 9cc250b50..4cc4f3de7 100644 --- a/Tests.hs +++ b/Tests.hs @@ -378,5 +378,5 @@ test_cacheLedger = assertEqual' 15 (length $ Map.keys $ accounts $ cacheLedger ledger7 nullpats) test_showLedgerAccounts = - assertEqual' 4 (length $ lines $ showLedgerAccounts l7 1) + assertEqual' 4 (length $ lines $ showLedgerAccountBalances l7 1) diff --git a/hledger.hs b/hledger.hs index a7c01fbdc..25031098d 100644 --- a/hledger.hs +++ b/hledger.hs @@ -19,7 +19,7 @@ This module includes some helpers for working with your ledger in ghci. Examples > Ledger with 696 entries, 132 accounts > *Main> putStr $ drawTree $ treemap show $ accountnametree l > ... -> *Main> putStr $ showLedgerAccounts l 1 +> *Main> putStr $ showLedgerAccountBalances l 1 > ... > *Main> printregister l > ... @@ -73,7 +73,7 @@ balance :: Command balance opts pats = parseLedgerAndDo opts pats printbalance where printbalance :: Ledger -> IO () - printbalance l = putStr $ showLedgerAccounts l depth + printbalance l = putStr $ showLedgerAccountBalances l depth where showsubs = (ShowSubs `elem` opts) depth = case (pats, showsubs) of