summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-07 04:55:51 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-07 04:55:51 -0400
commit66d007db9d4f7b793d53e08acc852b2bda335e32 (patch)
treedc2139a26125de4b589825cf6aa3f05da007a9e5 /src
parent71258f1fe9ec1e1ca3f11518914aad46fc54db20 (diff)
downloadledger-66d007db9d4f7b793d53e08acc852b2bda335e32.tar.gz
ledger-66d007db9d4f7b793d53e08acc852b2bda335e32.tar.bz2
ledger-66d007db9d4f7b793d53e08acc852b2bda335e32.zip
Fixed the way that --limit, --only and --display are handled.
Diffstat (limited to 'src')
-rw-r--r--src/report.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/report.h b/src/report.h
index d3ee6ea2..cdfb3b4e 100644
--- a/src/report.h
+++ b/src/report.h
@@ -139,6 +139,13 @@ public:
HANDLER(limit_).on(str);
}
+ void append_secondary_predicate(const string& str) {
+ if (HANDLED(only_))
+ HANDLER(only_).on(string("(") + HANDLER(only_).str() + ")&" + str);
+ else
+ HANDLER(only_).on(str);
+ }
+
void append_display_predicate(const string& str) {
if (HANDLED(display_))
HANDLER(display_).on(string("(") + HANDLER(display_).str() + ")&" + str);
@@ -205,7 +212,10 @@ public:
OPTION(report_t, daily);
OPTION(report_t, date_format_); // -y
OPTION(report_t, deviation); // -D
- OPTION(report_t, display_); // -d
+
+ OPTION_(report_t, display_, DO_(args) { // -d
+ parent->append_display_predicate(args[0].to_string());
+ });
OPTION__
(report_t, display_amount_,
@@ -246,14 +256,22 @@ public:
OPTION(report_t, gain); // -G
OPTION(report_t, head_);
OPTION(report_t, invert);
- OPTION(report_t, limit_); // -l
+
+ OPTION_(report_t, limit_, DO_(args) { // -l
+ parent->append_predicate(args[0].to_string());
+ });
+
OPTION(report_t, lot_dates);
OPTION(report_t, lot_prices);
OPTION(report_t, lot_tags);
OPTION(report_t, lots);
OPTION(report_t, market); // -V
OPTION(report_t, monthly); // -M
- OPTION(report_t, only_);
+
+ OPTION_(report_t, only_, DO_(args) { // -d
+ parent->append_secondary_predicate(args[0].to_string());
+ });
+
OPTION(report_t, output_); // -o
OPTION(report_t, pager_);
OPTION(report_t, percentage); // -%