summaryrefslogtreecommitdiff
path: root/src/chain.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-11 21:32:18 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-11 21:32:32 -0500
commit67c9cf134d1403657c766e72b96d692a7d538f65 (patch)
treecd72247ddf240746b524c8fecf6d10f8667b37e4 /src/chain.cc
parentc22b8457eff27f5227fdf452e036b33e41e229c2 (diff)
downloadfork-ledger-67c9cf134d1403657c766e72b96d692a7d538f65.tar.gz
fork-ledger-67c9cf134d1403657c766e72b96d692a7d538f65.tar.bz2
fork-ledger-67c9cf134d1403657c766e72b96d692a7d538f65.zip
Added --date, similar to --account and --payee
This lets you do things like store a date as the value of a tag, then run: ledger --date='has_tag("Foo") ? to_date(tag("Foo")) : date' reg
Diffstat (limited to 'src/chain.cc')
-rw-r--r--src/chain.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/chain.cc b/src/chain.cc
index 5839bd9e..55ef467b 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -159,6 +159,11 @@ post_handler_ptr chain_post_handlers(report_t& report,
handler.reset(new sort_posts(handler, "date"));
}
+ if (report.HANDLED(date_))
+ handler.reset(new transfer_details(handler, transfer_details::SET_DATE,
+ report.session.journal->master,
+ report.HANDLER(date_).str(),
+ report));
if (report.HANDLED(account_))
handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT,
report.session.journal->master,