diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-22 03:20:24 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-22 03:20:24 -0400 |
commit | 3f899c93e655945a775eecfe81d49fff8befba11 (patch) | |
tree | e10129a17ea729379a04f95423599809b1113934 /src/textual.cc | |
parent | 7da270129547aebd84ac0fde63b796f8add8e89a (diff) | |
download | ledger-3f899c93e655945a775eecfe81d49fff8befba11.tar.gz ledger-3f899c93e655945a775eecfe81d49fff8befba11.tar.bz2 ledger-3f899c93e655945a775eecfe81d49fff8befba11.zip |
Added new "bold" modifier to query expressions
For example:
ledger bal assets bold checking
Or you can use expressions:
ledger bal assets bold '=total > 1000'
This last is identical to saying:
ledger bal -l 'account =~ /assets/' --bold-if='total > 1000'
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc index 3238c55b..7ddb5251 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -534,9 +534,13 @@ void instance_t::automated_xact_directive(char * line) bool reveal_context = true; try { - std::auto_ptr<auto_xact_t> ae - (new auto_xact_t(query_t(string(skip_ws(line + 1)), - keep_details_t(true, true, true), false))); + query_t query; + keep_details_t keeper(true, true, true); + expr_t::ptr_op_t expr = + query.parse_args(string_value(skip_ws(line + 1)).to_sequence(), + keeper, false, true); + + std::auto_ptr<auto_xact_t> ae(new auto_xact_t(predicate_t(expr, keeper))); ae->pos = position_t(); ae->pos->pathname = pathname; ae->pos->beg_pos = line_beg_pos; |