mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +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
|
-- 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.
|
-- | Drop leading components of accounts names as specified by --drop, but only in --flat mode.
|
||||||
maybeAccountNameDrop :: ReportOpts -> AccountName -> AccountName
|
maybeAccountNameDrop :: ReportOpts -> AccountName -> AccountName
|
||||||
maybeAccountNameDrop opts a | flat_ opts = accountNameDrop (drop_ opts) a
|
maybeAccountNameDrop opts a | flat_ opts = accountNameDrop (drop_ opts) a
|
||||||
|
@ -98,5 +98,5 @@ accounts CliOpts{rawopts_=rawopts, reportopts_=ropts} j = do
|
|||||||
where
|
where
|
||||||
render a
|
render a
|
||||||
| tree_ ropts = T.replicate (2 * (accountNameLevel a - 1)) " " <> accountLeafName 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