mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
acc: don't require an explicit --flat to make --drop work
This commit is contained in:
parent
b72f9697a2
commit
4a399e50cb
@ -341,6 +341,7 @@ budgetReportAsTable
|
||||
))
|
||||
|
||||
-- XXX here for now
|
||||
-- TODO: does not work for flat-by-default reports with --flat not specified explicitly
|
||||
-- | Drop leading components of accounts names as specified by --drop, but only in --flat mode.
|
||||
maybeAccountNameDrop :: ReportOpts -> AccountName -> AccountName
|
||||
maybeAccountNameDrop opts a | flat_ opts = accountNameDrop (drop_ opts) a
|
||||
|
@ -98,5 +98,5 @@ accounts CliOpts{rawopts_=rawopts, reportopts_=ropts} j = do
|
||||
where
|
||||
render a
|
||||
| tree_ ropts = T.replicate (2 * (accountNameLevel a - 1)) " " <> accountLeafName a
|
||||
| otherwise = maybeAccountNameDrop ropts a
|
||||
| otherwise = accountNameDrop (drop_ ropts) a
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user