summaryrefslogtreecommitdiff
path: root/src/scope.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-05-08 02:06:06 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-05-08 02:06:06 -0400
commit4ec54b86f856c6e85446d065d2940b4244d71b8f (patch)
tree645c11578337991c7de83a4e3443a50b5c8a469a /src/scope.h
parentd5f8c3bc576d98266519911ec05a98cd586d49db (diff)
downloadfork-ledger-4ec54b86f856c6e85446d065d2940b4244d71b8f.tar.gz
fork-ledger-4ec54b86f856c6e85446d065d2940b4244d71b8f.tar.bz2
fork-ledger-4ec54b86f856c6e85446d065d2940b4244d71b8f.zip
Added any() and all() value expression macros
any() matches an expression against every post in a transaction or account, and returns true if any of them are true. all() tests if all are true. For example: ledger -l 'account =~ /Expense/ & any(account =~ /MasterCard/)' reg This reports every posting affecting an Expense account (regex match), but only if some other posting in the same transaction affects the MasterCard account. Both functions also take a second boolean argument. If it is false, the "source" posting is not considered. For example: ledger -l 'any(/x/, false)' This matches any posting where a *different* posting in the same transaction contains the letter 'x'.
Diffstat (limited to 'src/scope.h')
0 files changed, 0 insertions, 0 deletions