ref: tags test

This commit is contained in:
Simon Michael 2022-04-14 06:50:50 -10:00
parent 7a1d5e66e5
commit 7b4ab1e37a

View File

@ -1,28 +1,32 @@
# tags command # tags command
2000/1/1 ; ttag:foo account a ; t1:v1
(a) 1 ; ptag:bar
2000/1/2 ; ttag2:foo 2000/1/1 ; t2:v2
(a) 1 ; ptag:qux (b) 1 ; t3:v3
2000/1/2 ; t4:v4
(b) 1 ; t5:v5
# 1. list all tags # 1. list all tags
$ hledger -f - tags $ hledger -f - tags
ptag t2
ttag t3
ttag2 t4
t5
# 2. list tag names matching a regex # 2. list tag names matching a regex
$ hledger -f - tags ttag $ hledger -f - tags '[24]'
ttag t2
ttag2 t4
# 3. list tag values # 3. list tag values
$ hledger -f - tags --values $ hledger -f - tags --values
bar v2
foo v3
qux v4
v5
# 4. list values of tags matching a regex from transactions matching a query # 4. list values of tags matching a regex from transactions matching a query
$ hledger -f - tags --values ptag date:2000/1/1 $ hledger -f - tags t3 date:2000/1/1 --values
bar v3