summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-13 02:58:49 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-13 02:58:49 -0400
commitb134a98e1e86bed00f291c1eb2b6505b4d9a6b64 (patch)
treee5d6cb65efa9646ba752a3872dcba8d9a35c652e /src/report.cc
parent3f8412f4042239b2babfcd11d1d9544c85d935b2 (diff)
downloadfork-ledger-b134a98e1e86bed00f291c1eb2b6505b4d9a6b64.tar.gz
fork-ledger-b134a98e1e86bed00f291c1eb2b6505b4d9a6b64.tar.bz2
fork-ledger-b134a98e1e86bed00f291c1eb2b6505b4d9a6b64.zip
Enabled the --tail and --head options.
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/report.cc b/src/report.cc
index 42a9b186..e0ee8c1a 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -305,7 +305,6 @@ void report_t::xacts_report(xact_handler_ptr handler)
{
session_xacts_iterator walker(session);
pass_down_xacts(chain_xact_handlers(handler), walker);
- handler->flush();
if (DO_VERIFY())
session.clean_xacts();
@@ -315,7 +314,6 @@ void report_t::entry_report(xact_handler_ptr handler, entry_t& entry)
{
entry_xacts_iterator walker(entry);
pass_down_xacts(chain_xact_handlers(handler), walker);
- handler->flush();
if (DO_VERIFY())
session.clean_xacts(entry);
@@ -341,7 +339,6 @@ void report_t::accounts_report(acct_handler_ptr handler)
sorted_accounts_iterator walker(*session.master, sort_string);
pass_down_accounts(handler, walker, expr_t("total"));
}
- handler->flush();
if (DO_VERIFY()) {
session.clean_xacts();
@@ -373,7 +370,7 @@ namespace {
#endif
std::ostringstream out;
- args[0].dump(out, *first_width, *latter_width);
+ args[0].strip_annotations().dump(out, *first_width, *latter_width);
return string_value(out.str());
}
}
@@ -409,6 +406,11 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
return MAKE_FUNCTOR(report_t::option_format_);
break;
+ case 'h':
+ if (std::strcmp(p, "head_") == 0)
+ return MAKE_FUNCTOR(report_t::option_head_);
+ break;
+
case 'j':
if (! (*p + 1))
return MAKE_FUNCTOR(report_t::option_amount_data);
@@ -420,19 +422,22 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
break;
case 'l':
- if (std::strcmp(p, "l_") || std::strcmp(p, "limit_"))
+ if (std::strcmp(p, "l_") == 0
+ || std::strcmp(p, "limit_") == 0)
return MAKE_FUNCTOR(report_t::option_limit_);
break;
case 't':
- if (std::strcmp(p, "t_"))
+ if (std::strcmp(p, "t_") == 0)
return MAKE_FUNCTOR(report_t::option_amount_);
else if (std::strcmp(p, "total_") == 0)
return MAKE_FUNCTOR(report_t::option_total_);
+ else if (std::strcmp(p, "tail_") == 0)
+ return MAKE_FUNCTOR(report_t::option_tail_);
break;
case 'T':
- if (std::strcmp(p, "T_"))
+ if (std::strcmp(p, "T_") == 0)
return MAKE_FUNCTOR(report_t::option_total_);
break;
}