imp:stats: with multiple reports, add a blank line before runtime stats
This commit is contained in:
parent
c24054455f
commit
7db8e01200
@ -52,14 +52,15 @@ statsmode = hledgerCommandMode
|
|||||||
stats :: CliOpts -> Journal -> IO ()
|
stats :: CliOpts -> Journal -> IO ()
|
||||||
stats opts@CliOpts{rawopts_=rawopts, reportspec_=rspec, progstarttime_} j = do
|
stats opts@CliOpts{rawopts_=rawopts, reportspec_=rspec, progstarttime_} j = do
|
||||||
let today = _rsDay rspec
|
let today = _rsDay rspec
|
||||||
|
verbose = boolopt "verbose" rawopts
|
||||||
q = _rsQuery rspec
|
q = _rsQuery rspec
|
||||||
l = ledgerFromJournal q j
|
l = ledgerFromJournal q j
|
||||||
intervalspans = snd $ reportSpanBothDates j rspec
|
intervalspans = snd $ reportSpanBothDates j rspec
|
||||||
|
ismultiperiod = length intervalspans > 1
|
||||||
(ls, txncounts) = unzip $ map (showLedgerStats verbose l today) intervalspans
|
(ls, txncounts) = unzip $ map (showLedgerStats verbose l today) intervalspans
|
||||||
numtxns = sum txncounts
|
numtxns = sum txncounts
|
||||||
b = unlinesB ls
|
txt = (if ismultiperiod then id else TL.init) $ TB.toLazyText $ unlinesB ls
|
||||||
verbose = boolopt "verbose" rawopts
|
writeOutputLazyText opts txt
|
||||||
writeOutputLazyText opts $ TL.init $ TB.toLazyText b
|
|
||||||
t <- getPOSIXTime
|
t <- getPOSIXTime
|
||||||
let dt = t - progstarttime_
|
let dt = t - progstarttime_
|
||||||
rtsStatsEnabled <- getRTSStatsEnabled
|
rtsStatsEnabled <- getRTSStatsEnabled
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user