diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-10 21:58:28 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-10 21:58:28 -0600 |
commit | 2a4d7e1af0ac18693b0c1ffa39daa4ad51e1492f (patch) | |
tree | ad61c2433bb40f3f8b6e7f9d67e62ecbdc2f714b | |
parent | 860610fdaf94ca5904ea3e0d3d82126de74c7d80 (diff) | |
download | fork-ledger-2a4d7e1af0ac18693b0c1ffa39daa4ad51e1492f.tar.gz fork-ledger-2a4d7e1af0ac18693b0c1ffa39daa4ad51e1492f.tar.bz2 fork-ledger-2a4d7e1af0ac18693b0c1ffa39daa4ad51e1492f.zip |
Added --immediate option
-rw-r--r-- | doc/ledger.1 | 1 | ||||
-rw-r--r-- | src/report.cc | 6 | ||||
-rw-r--r-- | src/report.h | 2 | ||||
-rw-r--r-- | test/baseline/opt-immediate.test | 0 |
4 files changed, 9 insertions, 0 deletions
diff --git a/doc/ledger.1 b/doc/ledger.1 index d69d6c22..8076c7c4 100644 --- a/doc/ledger.1 +++ b/doc/ledger.1 @@ -339,6 +339,7 @@ See .It Fl \-help-calc .It Fl \-help-comm .It Fl \-help-disp +.It Fl \-immediate .It Fl \-import Ar STR .It Fl \-init-file Ar FILE .It Fl \-inject Ar STR diff --git a/src/report.cc b/src/report.cc index 8cfa7a59..bd2df046 100644 --- a/src/report.cc +++ b/src/report.cc @@ -162,6 +162,11 @@ void report_t::normalize_options(const string& verb) terminus); } + if (HANDLED(immediate) && HANDLED(market)) { + HANDLER(amount_) + .on("?normalize", "market(amount_expr, value_date, exchange)"); + } + long cols = 0; if (HANDLED(columns_)) cols = lexical_cast<long>(HANDLER(columns_).value); @@ -1080,6 +1085,7 @@ option_t<report_t> * report_t::lookup_option(const char * p) case 'i': OPT(invert); else OPT(inject_); + else OPT(immediate); break; case 'j': OPT_CH(amount_data); diff --git a/src/report.h b/src/report.h index 04fdcd45..a3825335 100644 --- a/src/report.h +++ b/src/report.h @@ -273,6 +273,7 @@ public: HANDLER(group_by_).report(out); HANDLER(group_title_format_).report(out); HANDLER(head_).report(out); + HANDLER(immediate).report(out); HANDLER(inject_).report(out); HANDLER(invert).report(out); HANDLER(limit_).report(out); @@ -704,6 +705,7 @@ public: "market(amount_expr, value_date, exchange))"); }); + OPTION(report_t, immediate); OPTION(report_t, inject_); OPTION_(report_t, invert, DO() { diff --git a/test/baseline/opt-immediate.test b/test/baseline/opt-immediate.test new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/baseline/opt-immediate.test |