mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-10 14:16:41 +03:00
2bb120d6c6
As part of adding -w in december I cleaned up/adjusted register field widths, and didn't make all the tests pass. This commit makes one more width adjustment (one space after the date instead of two) and fixes all tests depending on register output.
71 lines
1.6 KiB
Plaintext
71 lines
1.6 KiB
Plaintext
# 1. monthly reporting interval, no end dates, shows just the intervals with data:
|
|
hledgerdev -f- register --period 'monthly'
|
|
<<<
|
|
2011/2/1
|
|
(a) 1
|
|
>>>
|
|
2011/02/01 - 2011/02/28 a 1 1
|
|
>>>=0
|
|
|
|
# 2. or with a query pattern, just the intervals with matched data:
|
|
hledgerdev -f- register --period 'monthly' b
|
|
<<<
|
|
2011/1/1
|
|
(a) 1
|
|
|
|
2011/2/1
|
|
(b) 1
|
|
>>>
|
|
2011/02/01 - 2011/02/28 b 1 1
|
|
>>>=0
|
|
|
|
# 3. with --empty, show all intervals spanned by the journal
|
|
# (unlike current ledger, but more useful)
|
|
hledgerdev -f- register --period 'monthly' b --empty
|
|
<<<
|
|
2011/1/1
|
|
(a) 1
|
|
|
|
2011/2/1
|
|
(b) 1
|
|
|
|
2011/3/1
|
|
(c) 1
|
|
>>>
|
|
2011/01/01 - 2011/01/31 0 0
|
|
2011/02/01 - 2011/02/28 b 1 1
|
|
2011/03/01 - 2011/03/31 0 1
|
|
>>>=0
|
|
|
|
# 4. any specified begin/end dates limit the intervals reported
|
|
hledgerdev -f- register --period 'monthly to 2011/3/1' b --empty
|
|
<<<
|
|
2011/1/1
|
|
(a) 1
|
|
|
|
2011/2/1
|
|
(b) 1
|
|
|
|
2011/3/1
|
|
(c) 1
|
|
>>>
|
|
2011/01/01 - 2011/01/31 0 0
|
|
2011/02/01 - 2011/02/28 b 1 1
|
|
>>>=0
|
|
|
|
# 5. likewise for date-restricting display expressions
|
|
hledgerdev -f- register --period 'monthly to 2011/2/1' b --empty --display 'd<[2011/2/1]'
|
|
<<<
|
|
2011/1/1
|
|
(a) 1
|
|
|
|
2011/2/1
|
|
(b) 1
|
|
|
|
2011/3/1
|
|
(c) 1
|
|
>>>
|
|
2011/01/01 - 2011/01/31 0 0
|
|
>>>=0
|
|
|