acc: don't require an explicit --flat to make --drop work

This commit is contained in:
Simon Michael 2018-10-13 13:22:11 -07:00
parent b72f9697a2
commit 4a399e50cb
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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