stats :: CliOpts -> Journal -> IO ()
stats opts@CliOpts{reportopts_=reportopts_} j = do
  d <- getCurrentDay
  let q = queryFromOpts d reportopts_
      l = ledgerFromJournal q j
      reportspan = (ledgerDateSpan l) `spanDefaultsFrom` (queryDateSpan False q)
      intervalspans = splitSpan (interval_ reportopts_) reportspan
      showstats = showLedgerStats l d
      s = intercalate "\n" $ map showstats intervalspans
  writeOutput opts s
stats :: CliOpts -> Journal -> IO ()
stats opts@CliOpts{reportopts_=reportopts_} j = do
  d <- getCurrentDay
  let q = queryFromOpts d reportopts_
      l = ledgerFromJournal q j
      reportspan = (ledgerDateSpan l) `spanDefaultsFrom` (queryDateSpan False q)
      intervalspans = splitSpan (interval_ reportopts_) reportspan
      showstats = showLedgerStats l d
      s = intercalate "\n" $ map showstats intervalspans
  writeOutput opts s
stats opts@CliOpts{reportopts_=reportopts_} j = do
  d <- getCurrentDay
  let q = queryFromOpts d reportopts_
      l = ledgerFromJournal q j
      reportspan = (ledgerDateSpan l) `spanDefaultsFrom` (queryDateSpan False q)
      intervalspans = splitSpan (interval_ reportopts_) reportspan
      showstats = showLedgerStats l d
      s = intercalate "\n" $ map showstats intervalspans
  writeOutput opts s