cli: tabular reports no longer have a trailing blank line added

Tabular reports from bal, bs etc. have until now been rendered on
the terminal with one final blank line, for readability.
This change drops the blank line.

This is consistent with the non-tabular balance and register output
(not print, which is a special case), and with most unix commands.
The real reason for it, which I admit is flimsy, is that I can now omit
the final delimiter (>=0) when using shelltestrunner 1.9's new format,
making functional tests easier to maintain and more readable.
If there's opposition, this could be reverted.
This commit is contained in:
Simon Michael 2018-01-23 12:47:56 -08:00
parent e43c430a61
commit e491f513a1
13 changed files with 0 additions and 59 deletions

View File

@ -703,13 +703,11 @@ renderBalanceReportTable ropts =
renderBalanceReportTable' :: ReportOpts -> (a -> String) -> Table String String a -> String
renderBalanceReportTable' (ReportOpts { pretty_tables_ = pretty}) showCell =
unlines
. addtrailingblank
. trimborder
. lines
. render pretty id id showCell
. align
where
addtrailingblank = (++[""])
trimborder = drop 1 . init . map (drop 1 . init)
align (Table l t d) = Table l' t d
where

View File

@ -7,7 +7,6 @@ Ending balances (historical) in 2013/01:
|| 2013/01/31
=================++============
assets:checking || 10
>>>= 0
# 2. multiple flags ending with --tree, equivalent to --tree
@ -19,5 +18,4 @@ Ending balances (historical) in 2013/01:
============++============
assets || 10
checking || 10
>>>= 0

View File

@ -23,6 +23,5 @@ Balance changes in 2008/01:
... || 0
-----++---------
|| 0
>>>=0

View File

@ -21,7 +21,6 @@ Balance changes in 2013q1:
assets || 0 1 0
assets:cash || 0 1 0
assets:checking || 0 0 1
>>>=0
# 3. With --empty, includes leading/trailing empty periods
@ -42,7 +41,6 @@ Balance changes in 2013:
a || 2 0 0 0
---++--------------------------------
|| 2 0 0 0
>>>=0
# 4. A cumulative ending balance report. Column totals are the sum of
@ -58,7 +56,6 @@ Ending balances (cumulative) in 2013q1:
assets:checking || 0 0 1
-----------------++------------------------------------
|| 0 2 3
>>>=0
# 5. With the assets:cash account excluded. As with a single-column
@ -74,7 +71,6 @@ Ending balances (cumulative) in 2013q1:
assets:checking || 0 0 1
-----------------++------------------------------------
|| 0 1 2
>>>=0
# 6. A historical ending balance report.
@ -89,7 +85,6 @@ Ending balances (historical) in 2013q1:
assets:checking || 10 10 11
-----------------++------------------------------------
|| 10 12 13
>>>=0
# 7. With top-level accounts excluded. As always, column totals are the sum of
@ -104,7 +99,6 @@ Balance changes in 2013q1:
assets:checking || 0 0 1
-----------------++---------------------------
|| 0 1 1
>>>=0
# 8. cumulative:
@ -118,7 +112,6 @@ Ending balances (cumulative) in 2013q1:
assets:checking || 0 0 1
-----------------++------------------------------------
|| 0 1 2
>>>=0
# 9. historical
@ -133,7 +126,6 @@ Ending balances (historical) in 2013q1:
assets:checking || 10 10 11
-----------------++------------------------------------
|| 10 12 13
>>>=0
# --depth
@ -148,7 +140,6 @@ Balance changes in 2013q1:
assets || 0 2 1
--------++---------------------------
|| 0 2 1
>>>=0
# 11. As above, but postings in the top-level assets account have been excluded.
@ -161,7 +152,6 @@ Balance changes in 2013q1:
assets || 0 1 1
--------++---------------------------
|| 0 1 1
>>>=0
# 12. A cumulative balance report with depth limiting.
@ -174,7 +164,6 @@ Ending balances (cumulative) in 2013q1:
assets || 0 2 3
--------++------------------------------------
|| 0 2 3
>>>=0
# 13. A historical balance report with depth limiting.
@ -187,7 +176,6 @@ Ending balances (historical) in 2013q1:
assets || 10 12 13
--------++------------------------------------
|| 10 12 13
>>>=0
# 14. The three multicol balance report types again, this time with --tree
@ -202,7 +190,6 @@ Balance changes in 2013q1:
checking || 0 0 1
------------++---------------------------
|| 0 2 1
>>>=0
# 15.
@ -217,7 +204,6 @@ Ending balances (cumulative) in 2013q1:
checking || 0 0 1
------------++------------------------------------
|| 0 2 3
>>>=0
# 16.
@ -232,7 +218,6 @@ Ending balances (historical) in 2013q1:
checking || 10 10 11
------------++------------------------------------
|| 10 12 13
>>>=0
# 17. --date2 should work
@ -253,7 +238,6 @@ Balance changes in 2014/01:
b || 1
---++---------
|| 2
>>>=0
# 18. All matched postings in the displayed intervals should be reported on.
@ -278,5 +262,4 @@ Balance changes in 2014/01/01-2014/02/28:
within || 0 1
--------++------------------
|| 1 2
>>>=0

View File

@ -9,5 +9,4 @@ Balance changes in 2012/12/01-2013/03/31:
assets:checking ║ 10 0 0 1
─────────────────╫────────────────────────────────────
║ 10 0 2 1
>>>=0

View File

@ -21,7 +21,6 @@ Balance Sheet 2016/01/01
||
=============++============
Net: || 1
>>>2
>>>= 0
@ -68,7 +67,6 @@ Balance Sheet 2008
|| 0 0 0 0 0 0 0 0 0 0 0 $-1
======================++================================================================================================================================================
Net: || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
>>>=0
# 3. monthly balance sheet in tree mode
@ -118,7 +116,6 @@ Balance Sheet 2008
|| 0 0 0 0 0 0 0 0 0 0 0 $-1
==============++================================================================================================================================================
Net: || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
>>>= 0
# 4. monthly balancesheet with average/total columns and without overall totals row
@ -141,7 +138,6 @@ Balance Sheet 2008
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $-1 $-1 0
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $-1 $-1 0
>>>= 0
# 5. Tree output still works, #565
@ -167,7 +163,6 @@ Balance Sheet 2017/01/01
||
=============++============
Net: || 1
>>>2
>>>=0
@ -193,7 +188,6 @@ Balance Sheet 2017/01/01
||
=============++============
Net: || 1
>>>2
>>>=0
@ -219,7 +213,6 @@ Balance Sheet 2017/01/01
||
=============++==============================
Net: || $1 $1 $1
>>>2
>>>=0
@ -246,6 +239,5 @@ Balance Sheet 2016/01/01
═════════════╬════════════
Net: ║ 1
>>>2
>>>= 0

View File

@ -41,7 +41,6 @@ Ending balances (historical) in 2016/12/31-2017/01/02:
budget:food || 0 $-50.00 $-50.00
budget:housing || $-600.00 $-600.00 $-600.00
budget:misc || 0 $-15.00 $-16.60
>>>2
>>>=0
@ -160,7 +159,6 @@ Ending balances (historical) in 2016/12/26-2017/01/04:
expenses:grocery || $-50 $-50 $-50 $-50 $-50 $-50 $-20.00 $-70.00 $-70.00 $-70.00
expenses:housing || $-250 $-250 $-250 $-250 $-250 $350.00 $350.00 $100.00 $100.00 $100.00
expenses:leisure || $-20 $-20 $-20 $-20 $-20 $-20 $-5.00 $-25.00 $-25.00 $-25.00
>>>2
>>>=0
@ -194,7 +192,6 @@ Ending balances (historical) in 2016/12/31-2017/01/01:
expenses:grocery || 0 $30
expenses:housing:rent || $600 $600
expenses:leisure || 0 $15
>>>2
>>>=0
@ -226,7 +223,6 @@ Ending balances (historical) in 2016/12/31-2017/01/01:
===============++========================
<unbucketed> || $600 $646
expenses:food || 0 $20
>>>2
>>>=0
@ -260,6 +256,5 @@ Ending balances (historical) in 2016/12/31-2017/01/01:
expenses:grocery || 0 $30
expenses:housing:rent || $600 $600
expenses:leisure || 0 $15
>>>2
>>>=0

View File

@ -40,7 +40,6 @@ Balance changes in 2016/12/01-2016/12/03:
expenses:leisure || 0 [0% of $15] $5 [33% of $15] 0 [0% of $15]
-----------------------++-------------------------------------------------------------
|| 0 0 0
>>>2
>>>=0
@ -87,7 +86,6 @@ Balance changes in 2016/12/01-2016/12/03:
expenses:movies || 0 0 $25
------------------++-------------------------------------------------------------
|| 0 0 0
>>>2
>>>=0
@ -137,6 +135,5 @@ Balance changes in 2016/12/01-2016/12/03:
expenses:leisure || 0 [0% of $15] $5 [33% of $15] 0 [0% of $15]
-----------------------++----------------------------------------------------------------
|| $-15, £10 $-21.0, 20 CAD 0
>>>2
>>>=0

View File

@ -24,7 +24,6 @@ Balance changes in 2016/12/01-2017/01/31:
income || 0 $-1000
------------------++------------------
|| 0 0
>>>2
>>>=0

View File

@ -14,7 +14,6 @@ Cashflow Statement 2016/01/01
assets || 1
------------++------------
|| 1
>>>2
>>>= 0
@ -50,7 +49,6 @@ Cashflow Statement 2016
assets:checking || $-40.00
-----------------++---------
|| $-40.00
>>>2
>>>= 0
@ -86,7 +84,6 @@ Cashflow Statement 2015/01/01-2016/12/31
assets:checking || $9,960.00
-----------------++-----------------------
|| $9,960.00
>>>2
>>>= 0
@ -122,7 +119,6 @@ Cashflow Statement 2015/11
assets:checking || $10,000.00
-----------------++------------
|| $10,000.00
>>>2
>>>= 0
@ -157,7 +153,6 @@ Cashflow Statement 2016/10
------------++---------
------------++---------
|| 0
>>>2
>>>= 0
@ -175,7 +170,6 @@ Cashflow Statement 2008
assets:cash || 0 0 0 0 0 $-2 0 0 0 0 0 0
----------------------++------------------------------------------------------------------------------------------------------------
|| $1 0 0 0 0 $-1 0 0 0 0 0 $-1
>>>= 0
# 7. Multicolumn test (historical)
@ -192,7 +186,6 @@ Cashflow Statement 2008 (Historical Ending Balances)
assets:cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2 $-1
----------------------++---------------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1 0
>>>= 0
# 8. without -N/--no-total
@ -208,7 +201,6 @@ Cashflow Statement 2008
assets:cash || $-2
--------------------++------
|| $-1
>>>2
>>>= 0
@ -223,7 +215,6 @@ Cashflow Statement 2008
--------------------++------
assets:bank:saving || $1
assets:cash || $-2
>>>2
>>>= 0
@ -247,6 +238,5 @@ Cashflow Statement 2016/01/01
assets || 1
------------++------------
|| 1
>>>2
>>>= 0

View File

@ -18,7 +18,6 @@ Income Statement 2014/01/01-2014/01/02
|| $2
==========================++=======================
Net: || $-2
>>>2
>>>=0

View File

@ -71,7 +71,6 @@ Balance changes in 2014:
㐀:㐁:㐂:㐃:㐄 || 1
----------------++------
|| 0
>>>2
>>>=0

View File

@ -21,7 +21,6 @@ Income Statement 2016/01/01
||
==========++============
Net: || -1
>>>2
>>>= 0
@ -65,7 +64,6 @@ Income Statement 2016
|| $50.00
===================++=========
Net: || $-40.00
>>>2
>>>= 0
@ -110,7 +108,6 @@ Income Statement 2015/01/01-2016/12/31
|| $50.00
===================++=======================
Net: || $9,960.00
>>>2
>>>= 0
@ -153,7 +150,6 @@ Income Statement 2015/10
||
===================++============
Net: || $10,000.00
>>>2
>>>= 0
@ -195,7 +191,6 @@ Income Statement 2016/10
|| 0
==========++=========
Net: || 0
>>>2
>>>= 0
@ -242,7 +237,6 @@ Income Statement 2008
|| 0 0 0 0 0 $2 0 0 0 0 0 0 $2 0
===================++==============================================================================================================================
Net: || $1 0 0 0 0 $-1 0 0 0 0 0 0 0 0
>>>= 0
# 7. Multicolumn test (historical)
@ -288,5 +282,4 @@ Income Statement 2008 (Historical Ending Balances)
|| 0 0 0 0 0 $2 $2 $2 $2 $2 $2 $2
===================++================================================================================================================================================
Net: || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
>>>= 0