Skip to content

Commit

Permalink
imp:stats: with multiple reports, add a blank line before runtime stats
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Mar 2, 2024
1 parent c240544 commit 7db8e01
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hledger/Hledger/Cli/Commands/Stats.hs
Expand Up @@ -52,14 +52,15 @@ statsmode = hledgerCommandMode
stats :: CliOpts -> Journal -> IO ()
stats opts@CliOpts{rawopts_=rawopts, reportspec_=rspec, progstarttime_} j = do
let today = _rsDay rspec
verbose = boolopt "verbose" rawopts
q = _rsQuery rspec
l = ledgerFromJournal q j
intervalspans = snd $ reportSpanBothDates j rspec
ismultiperiod = length intervalspans > 1
(ls, txncounts) = unzip $ map (showLedgerStats verbose l today) intervalspans
numtxns = sum txncounts
b = unlinesB ls
verbose = boolopt "verbose" rawopts
writeOutputLazyText opts $ TL.init $ TB.toLazyText b
txt = (if ismultiperiod then id else TL.init) $ TB.toLazyText $ unlinesB ls
writeOutputLazyText opts txt
t <- getPOSIXTime
let dt = t - progstarttime_
rtsStatsEnabled <- getRTSStatsEnabled
Expand Down

0 comments on commit 7db8e01

Please sign in to comment.