2017-06-10 04:59:07 +03:00
|
|
|
## parsing
|
|
|
|
|
|
|
|
# 1. transactions and postings have status marks which are nothing, ! or *
|
|
|
|
hledger -fstatus.journal print
|
2015-05-16 23:04:22 +03:00
|
|
|
>>>
|
2017-06-16 02:25:37 +03:00
|
|
|
2017/01/01 unmarked
|
2017-06-10 04:59:07 +03:00
|
|
|
(a) 1
|
|
|
|
(b) 1
|
|
|
|
|
|
|
|
2017/01/02 ! pending
|
2017-06-05 07:26:18 +03:00
|
|
|
(a) 1
|
2017-06-10 04:59:07 +03:00
|
|
|
! (b) 1
|
|
|
|
|
|
|
|
2017/01/03 * cleared
|
|
|
|
(a) 1
|
|
|
|
* (b) 1
|
2015-05-16 23:04:22 +03:00
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
2017-06-10 04:59:07 +03:00
|
|
|
# 2. other characters will be considered part of the description
|
|
|
|
hledger -f- print desc:%
|
2015-05-16 23:04:22 +03:00
|
|
|
<<<
|
2017-06-10 04:59:07 +03:00
|
|
|
2017/01/01 %
|
2015-05-16 23:04:22 +03:00
|
|
|
>>>
|
2017-06-10 04:59:07 +03:00
|
|
|
2017/01/01 %
|
2015-05-16 23:04:22 +03:00
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
2017-06-10 04:59:07 +03:00
|
|
|
## matching with flags
|
|
|
|
|
|
|
|
# 3. --cleared matches * only
|
|
|
|
hledger -fstatus.journal print --cleared
|
2015-05-16 23:04:22 +03:00
|
|
|
>>>
|
2017-06-10 04:59:07 +03:00
|
|
|
2017/01/03 * cleared
|
2017-06-05 07:26:18 +03:00
|
|
|
(a) 1
|
2017-06-10 04:59:07 +03:00
|
|
|
* (b) 1
|
2015-05-16 23:04:22 +03:00
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
2017-06-10 04:59:07 +03:00
|
|
|
# 4. --pending matches ! only
|
|
|
|
hledger -fstatus.journal print --pending
|
2015-05-16 23:04:22 +03:00
|
|
|
>>>
|
2017-06-10 04:59:07 +03:00
|
|
|
2017/01/02 ! pending
|
|
|
|
(a) 1
|
|
|
|
! (b) 1
|
2015-05-16 23:04:22 +03:00
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
2017-06-16 02:25:37 +03:00
|
|
|
# 5. --unmarked matches no status mark only
|
|
|
|
hledger -fstatus.journal print --unmarked
|
2015-05-16 23:04:22 +03:00
|
|
|
>>>
|
2017-06-16 02:25:37 +03:00
|
|
|
2017/01/01 unmarked
|
2017-06-10 04:59:07 +03:00
|
|
|
(a) 1
|
2017-06-05 07:26:18 +03:00
|
|
|
(b) 1
|
2015-05-16 23:04:22 +03:00
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
2017-06-10 23:30:48 +03:00
|
|
|
# 6. these flags can be combined
|
2017-06-16 02:25:37 +03:00
|
|
|
hledger -fstatus.journal register --unmarked --pending
|
2015-05-16 23:04:22 +03:00
|
|
|
>>>
|
2017-06-16 02:25:37 +03:00
|
|
|
2017/01/01 unmarked (a) 1 1
|
2017-06-10 04:59:07 +03:00
|
|
|
(b) 1 2
|
2017-06-10 23:30:48 +03:00
|
|
|
2017/01/02 pending (a) 1 3
|
|
|
|
(b) 1 4
|
2017-06-10 04:59:07 +03:00
|
|
|
>>>= 0
|
|
|
|
|
|
|
|
# 7. these flags work with other commands
|
2017-06-16 02:25:37 +03:00
|
|
|
hledger -fstatus.journal balance -N --unmarked
|
2017-06-10 04:59:07 +03:00
|
|
|
>>>
|
2017-06-10 20:24:10 +03:00
|
|
|
1 a
|
|
|
|
1 b
|
2017-06-10 04:59:07 +03:00
|
|
|
>>>=0
|
|
|
|
|
|
|
|
## matching with status: query
|
|
|
|
|
|
|
|
# 8. status:* matches * only
|
|
|
|
hledger -fstatus.journal print status:*
|
|
|
|
>>>
|
|
|
|
2017/01/03 * cleared
|
2017-06-05 07:26:18 +03:00
|
|
|
(a) 1
|
2017-06-10 04:59:07 +03:00
|
|
|
* (b) 1
|
2015-05-16 23:04:22 +03:00
|
|
|
|
2017-06-10 04:59:07 +03:00
|
|
|
>>>=0
|
|
|
|
|
|
|
|
# 9. status:! matches ! only
|
|
|
|
hledger -fstatus.journal print status:!
|
|
|
|
>>>
|
|
|
|
2017/01/02 ! pending
|
|
|
|
(a) 1
|
|
|
|
! (b) 1
|
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
2017-06-10 20:24:10 +03:00
|
|
|
# 10. status: matches unmarked only
|
2017-06-10 04:59:07 +03:00
|
|
|
hledger -fstatus.journal print status:
|
|
|
|
>>>
|
2017-06-16 02:25:37 +03:00
|
|
|
2017/01/01 unmarked
|
2017-06-10 04:59:07 +03:00
|
|
|
(a) 1
|
2017-06-05 07:26:18 +03:00
|
|
|
(b) 1
|
2015-05-16 23:04:22 +03:00
|
|
|
|
|
|
|
>>>=0
|
2017-06-10 04:59:07 +03:00
|
|
|
|
2017-06-10 23:31:43 +03:00
|
|
|
# 11. multiple status: queries are OR'd
|
|
|
|
hledger -fstatus.journal print status: status:!
|
|
|
|
>>>
|
2017-06-16 02:25:37 +03:00
|
|
|
2017/01/01 unmarked
|
2017-06-10 23:31:43 +03:00
|
|
|
(a) 1
|
|
|
|
(b) 1
|
|
|
|
|
|
|
|
2017/01/02 ! pending
|
|
|
|
(a) 1
|
|
|
|
! (b) 1
|
|
|
|
|
|
|
|
>>>= 0
|
|
|
|
|