summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/report.cc43
-rw-r--r--src/report.h45
2 files changed, 70 insertions, 18 deletions
diff --git a/src/report.cc b/src/report.cc
index 5d7504a1..d755bade 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -409,7 +409,9 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
break;
case 'c':
- if (std::strcmp(p, "comm_as_payee") == 0)
+ if (std::strcmp(p, "collapse") == 0)
+ return MAKE_FUNCTOR(report_t::option_collapse);
+ else if (std::strcmp(p, "comm_as_payee") == 0)
return MAKE_FUNCTOR(report_t::option_comm_as_payee);
else if (std::strcmp(p, "code_as_payee") == 0)
return MAKE_FUNCTOR(report_t::option_code_as_payee);
@@ -426,6 +428,8 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
if (std::strcmp(p, "e_") == 0 ||
std::strcmp(p, "end_") == 0)
return MAKE_FUNCTOR(report_t::option_end_);
+ else if (std::strcmp(p, "empty") == 0)
+ return MAKE_FUNCTOR(report_t::option_empty);
break;
case 'f':
@@ -455,10 +459,17 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
return MAKE_FUNCTOR(report_t::option_monthly);
break;
+ case 'n':
+ if (std::strcmp(p, "n") == 0)
+ return MAKE_FUNCTOR(report_t::option_collapse);
+ break;
+
case 'p':
if (std::strcmp(p, "p_") == 0 ||
std::strcmp(p, "period_") == 0)
return MAKE_FUNCTOR(report_t::option_period_);
+ else if (std::strcmp(p, "period_sort_") == 0)
+ return MAKE_FUNCTOR(report_t::option_period_sort_);
break;
case 'q':
@@ -466,11 +477,31 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
return MAKE_FUNCTOR(report_t::option_quarterly);
break;
+ case 'r':
+ if (std::strcmp(p, "r") == 0 ||
+ std::strcmp(p, "related") == 0)
+ return MAKE_FUNCTOR(report_t::option_related);
+ break;
+
+ case 's':
+ if (std::strcmp(p, "s") == 0 ||
+ std::strcmp(p, "subtotal") == 0)
+ return MAKE_FUNCTOR(report_t::option_subtotal);
+ else if (std::strcmp(p, "sort_") == 0)
+ return MAKE_FUNCTOR(report_t::option_sort_);
+ else if (std::strcmp(p, "sort_entries_") == 0)
+ return MAKE_FUNCTOR(report_t::option_sort_entries_);
+ else if (std::strcmp(p, "sort_all_") == 0)
+ return MAKE_FUNCTOR(report_t::option_sort_all_);
+ break;
+
case '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, "totals") == 0)
+ return MAKE_FUNCTOR(report_t::option_totals);
else if (std::strcmp(p, "tail_") == 0)
return MAKE_FUNCTOR(report_t::option_tail_);
break;
@@ -490,6 +521,11 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
return MAKE_FUNCTOR(report_t::option_yearly);
break;
+ case 'E':
+ if (std::strcmp(p, "E") == 0)
+ return MAKE_FUNCTOR(report_t::option_empty);
+ break;
+
case 'J':
if (! (*p + 1))
return MAKE_FUNCTOR(report_t::option_total_data);
@@ -505,6 +541,11 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
return MAKE_FUNCTOR(report_t::option_by_payee);
break;
+ case 'S':
+ if (std::strcmp(p, "S_") == 0)
+ return MAKE_FUNCTOR(report_t::option_sort_);
+ break;
+
case 'T':
if (std::strcmp(p, "T_") == 0)
return MAKE_FUNCTOR(report_t::option_total_);
diff --git a/src/report.h b/src/report.h
index ed3d009a..03b80bc2 100644
--- a/src/report.h
+++ b/src/report.h
@@ -437,47 +437,58 @@ public:
value_t option_abbrev_len(call_scope_t& args) { // :
format_t::abbrev_length = std::atoi(optarg);
}
+#endif
value_t option_empty(call_scope_t& args) { // E
- report->show_empty = true;
+ show_empty = true;
+ return true;
}
value_t option_collapse(call_scope_t& args) { // n
- report->show_collapsed = true;
+ show_collapsed = true;
+ return true;
}
value_t option_subtotal(call_scope_t& args) { // s
- report->show_subtotal = true;
+ show_subtotal = true;
+ return true;
}
value_t option_totals(call_scope_t& args) {
- report->show_totals = true;
+ show_totals = true;
+ return true;
}
- value_t option_sort(call_scope_t& args) { // S:
- report->sort_string = optarg;
+ value_t option_sort_(call_scope_t& args) { // S:
+ sort_string = args[0].to_string();
+ return true;
}
- value_t option_sort_entries(call_scope_t& args) {
- report->sort_string = optarg;
- report->entry_sort = true;
+ value_t option_sort_entries_(call_scope_t& args) {
+ sort_string = args[0].to_string();
+ entry_sort = true;
+ return true;
}
- value_t option_sort_all(call_scope_t& args) {
- report->sort_string = optarg;
- report->entry_sort = false;
- report->sort_all = true;
+ value_t option_sort_all_(call_scope_t& args) {
+ sort_string = args[0].to_string();
+ entry_sort = false;
+ sort_all = true;
+ return true;
}
- value_t option_period_sort(call_scope_t& args) { // :
- report->sort_string = optarg;
- report->entry_sort = true;
+ value_t option_period_sort_(call_scope_t& args) { // :
+ sort_string = args[0].to_string();
+ entry_sort = true;
+ return true;
}
value_t option_related(call_scope_t& args) { // r
- report->show_related = true;
+ show_related = true;
+ return true;
}
+#if 0
value_t option_descend(call_scope_t& args) {
std::string arg(optarg);
std::string::size_type beg = 0;