summaryrefslogtreecommitdiff
path: root/config.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-10-19 23:26:40 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:19 -0400
commitaa4cb6c37182dd2821fc6ba52cde70e05f7c7e34 (patch)
tree8c678ed36919f0bfbc664ca14e9827e2d2ed6a84 /config.cc
parentc1b998980f308e321519c69b40b4ab9ced09f348 (diff)
downloadfork-ledger-aa4cb6c37182dd2821fc6ba52cde70e05f7c7e34.tar.gz
fork-ledger-aa4cb6c37182dd2821fc6ba52cde70e05f7c7e34.tar.bz2
fork-ledger-aa4cb6c37182dd2821fc6ba52cde70e05f7c7e34.zip
When computing a report period, use the direct results of the parse
rather than passing back to --begin and --end.
Diffstat (limited to 'config.cc')
-rw-r--r--config.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/config.cc b/config.cc
index 7dfcc2fc..a7afd152 100644
--- a/config.cc
+++ b/config.cc
@@ -796,11 +796,21 @@ OPT_BEGIN(period, "p:") {
interval_t interval(config.report_period);
if (interval.begin) {
std::strftime(buf, 127, formats[0], std::localtime(&interval.begin));
- process_option(config_options, "begin", buf);
+
+ if (! config.predicate.empty())
+ config.predicate += "&";
+ config.predicate += "d>=[";
+ config.predicate += buf;
+ config.predicate += "]";
}
if (interval.end) {
std::strftime(buf, 127, formats[0], std::localtime(&interval.end));
- process_option(config_options, "end", buf);
+
+ if (! config.predicate.empty())
+ config.predicate += "&";
+ config.predicate += "d<[";
+ config.predicate += buf;
+ config.predicate += "]";
}
} OPT_END(period);
@@ -893,10 +903,12 @@ OPT_BEGIN(amount_data, "j") {
config.format_string = config.plot_amount_format;
} OPT_END(amount_data);
+
OPT_BEGIN(total_data, "J") {
config.format_string = config.plot_total_format;
} OPT_END(total_data);
+
//////////////////////////////////////////////////////////////////////
//
// Commodity reporting