Skip to content

Commit

Permalink
cli: Commands.Aregister: support option --cumulative
Browse files Browse the repository at this point in the history
  • Loading branch information
thielema committed Oct 21, 2024
1 parent 95ef5fa commit be53a7e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hledger/Hledger/Cli/Commands/Aregister.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ aregistermode = hledgerCommandMode
([
flagNone ["txn-dates"] (setboolopt "txn-dates")
"filter strictly by transaction date, not posting date. Warning: this can show a wrong running balance."
,flagNone ["no-elide"] (setboolopt "no-elide") "don't show only 2 commodities per amount"
-- flagNone ["cumulative"] (setboolopt "cumulative")
-- "show running total from report start date (default)"
-- ,flagNone ["historical","H"] (setboolopt "historical")
-- "show historical running total/balance (includes postings before report start date)\n "
,flagNone ["no-elide"] (setboolopt "no-elide") "don't show only 2 commodities per amount"
,flagNone ["cumulative"] (setboolopt "cumulative")
"show running total from report start date"
,flagNone ["historical","H"] (setboolopt "historical")
"show historical running total/balance (includes postings before report start date) (default)\n "
-- ,flagNone ["average","A"] (setboolopt "average")
-- "show running average of posting amounts instead of total (implies --empty)"
-- ,flagNone ["related","r"] (setboolopt "related") "show postings' siblings instead"
Expand Down Expand Up @@ -98,7 +98,10 @@ aregister opts@CliOpts{rawopts_=rawopts,reportspec_=rspec} j = do
-- ignore any depth limit, as in postingsReport; allows register's total to match balance reports (cf #1468)
depth_=Nothing
-- always show historical balance
, balanceaccum_= Historical
, balanceaccum_ =
case balanceaccum_ $ _rsReportOpts rspec of
PerPeriod -> Historical
ba -> ba
, querystring_ = querystr
}
wd = whichDate ropts'
Expand Down

0 comments on commit be53a7e

Please sign in to comment.