summaryrefslogtreecommitdiff
path: root/src/chain.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-02-02 17:07:05 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-02-02 17:07:05 -0500
commit141308597784f77414032b00f239e0601f9d4d38 (patch)
treecfbe1311abbffc7fd05578f8cf0f8ffdf4120f84 /src/chain.cc
parenta56a1db66294c06c7b9d582f694538a0cb473abf (diff)
downloadfork-ledger-141308597784f77414032b00f239e0601f9d4d38.tar.gz
fork-ledger-141308597784f77414032b00f239e0601f9d4d38.tar.bz2
fork-ledger-141308597784f77414032b00f239e0601f9d4d38.zip
Added a --pivot=TAG option
This is equivalent to the following: --account='"TAG:" + tag(/TAG/)'
Diffstat (limited to 'src/chain.cc')
-rw-r--r--src/chain.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/chain.cc b/src/chain.cc
index 113a71d8..ecb39e0b 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -158,11 +158,21 @@ post_handler_ptr chain_post_handlers(report_t& report,
report.session.journal->master,
report.HANDLER(date_).str(),
report));
- if (report.HANDLED(account_))
+
+ if (report.HANDLED(account_)) {
handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT,
report.session.journal->master,
report.HANDLER(account_).str(),
report));
+ }
+ else if (report.HANDLED(pivot_)) {
+ string pivot = report.HANDLER(pivot_).str();
+ pivot = string("\"") + pivot + ":\" + tag(/" + pivot + "/)";
+ handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT,
+ report.session.journal->master, pivot,
+ report));
+ }
+
if (report.HANDLED(payee_))
handler.reset(new transfer_details(handler, transfer_details::SET_PAYEE,
report.session.journal->master,