From 5df70bb3f42f1233e7358315e8b3484b4621da46 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 17 Oct 2008 16:58:09 +0000 Subject: [PATCH] rename --showsubs to --subtotal, like ledger --- BalanceCommand.hs | 8 ++++---- Options.hs | 4 ++-- Tests.hs | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BalanceCommand.hs b/BalanceCommand.hs index 07bda7f17..c634bc329 100644 --- a/BalanceCommand.hs +++ b/BalanceCommand.hs @@ -29,7 +29,7 @@ The balance command shows top-level accounts by default: $1 liabilities @ -With -s (--showsubs), also show the subaccounts: +With -s (--subtotal), also show the subaccounts: @ $-1 assets @@ -88,7 +88,7 @@ Some notes for the implementation: - with an account pattern, it shows accounts whose leafname matches, plus their parents -- with the showsubs option, it also shows all subaccounts of the above +- with the subtotal option, it also shows all subaccounts of the above - zero-balance leaf accounts are removed @@ -125,7 +125,7 @@ showBalanceReport opts args l = acctsstr ++ totalstr totalstr = if isZeroMixedAmount total then "" else printf "--------------------\n%20s\n" $ showMixedAmount total - showingsubs = ShowSubs `elem` opts + showingsubs = SubTotal `elem` opts pats@(apats,dpats) = parseAccountDescriptionArgs args maxdepth = if null args && not showingsubs then 1 else 9999 acctstoshow = balancereportaccts showingsubs apats l @@ -146,7 +146,7 @@ showBalanceReport opts args l = acctsstr ++ totalstr addsubaccts l as = concatMap addsubs as where addsubs = maybe [] flatten . ledgerAccountTreeAt l -- remove any accounts from the tree which are not one of the acctstoshow, - -- or one of their parents, or one of their subaccounts when doing --showsubs + -- or one of their parents, or one of their subaccounts when doing --subtotal pruneUnmatchedAccounts :: Tree Account -> Tree Account pruneUnmatchedAccounts = treefilter matched where diff --git a/Options.hs b/Options.hs index 071fb0b8a..c01fa9610 100644 --- a/Options.hs +++ b/Options.hs @@ -28,7 +28,7 @@ options = [ Option ['e'] ["end"] (ReqArg End "YYYY/MM/DD") "report on entries prior to this date", Option ['C'] ["cleared"] (NoArg Cleared) "report only on cleared entries", Option ['R'] ["real"] (NoArg Real) "report only on real (non-virtual) transactions", - Option ['s'] ["showsubs"] (NoArg ShowSubs) "in the balance report, include subaccounts", + Option ['s'] ["subtotal"] (NoArg SubTotal) "in the balance report, include subaccounts", Option ['h'] ["help","usage"] (NoArg Help) "show this help", Option ['V'] ["version"] (NoArg Version) "show version" ] @@ -40,7 +40,7 @@ data Opt = End String | Cleared | Real | - ShowSubs | + SubTotal | Help | Version deriving (Show,Eq) diff --git a/Tests.hs b/Tests.hs index 008baea7d..b9c2df078 100644 --- a/Tests.hs +++ b/Tests.hs @@ -111,7 +111,7 @@ balancecommandtests = TestList [ \" --" (showBalanceReport [] [] l) , - "balance report with showsubs" ~: do + "balance report with --subtotal" ~: do l <- ledgerfromfile "sample.ledger" assertequal " $-1 assets\n\ @@ -125,7 +125,7 @@ balancecommandtests = TestList [ \ $-1 salary\n\ \ $1 liabilities:debts\n\ \" --" - (showBalanceReport [ShowSubs] [] l) + (showBalanceReport [SubTotal] [] l) , "balance report with account pattern o" ~: do l <- ledgerfromfile "sample.ledger" @@ -137,7 +137,7 @@ balancecommandtests = TestList [ \" --" (showBalanceReport [] ["o"] l) , - "balance report with account pattern o and showsubs" ~: do + "balance report with account pattern o and --subtotal" ~: do l <- ledgerfromfile "sample.ledger" assertequal " $1 expenses:food\n\ @@ -147,7 +147,7 @@ balancecommandtests = TestList [ \--------------------\n\ \ $-1\n\ \" --" - (showBalanceReport [ShowSubs] ["o"] l) + (showBalanceReport [SubTotal] ["o"] l) , "balance report with account pattern a" ~: do l <- ledgerfromfile "sample.ledger"