diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-18 23:15:22 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-18 23:19:51 -0500 |
commit | e27ba3e1ff77537ade8287f1d66cf6fe626c8962 (patch) | |
tree | 2b3750dd02a41a295582091f23f22416ee6fedba /src/precmd.cc | |
parent | 93b8f3fe54814850fb2944e7467cd6ccc817b3ba (diff) | |
download | fork-ledger-e27ba3e1ff77537ade8287f1d66cf6fe626c8962.tar.gz fork-ledger-e27ba3e1ff77537ade8287f1d66cf6fe626c8962.tar.bz2 fork-ledger-e27ba3e1ff77537ade8287f1d66cf6fe626c8962.zip |
It's OK for a report query to be empty
It's always possible the user only specified a display predicate.
Diffstat (limited to 'src/precmd.cc')
-rw-r--r-- | src/precmd.cc | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/precmd.cc b/src/precmd.cc index 516b90dd..31249016 100644 --- a/src/precmd.cc +++ b/src/precmd.cc @@ -184,14 +184,12 @@ value_t args_command(call_scope_t& args) out << std::endl << std::endl; query_t query(args.value(), report.what_to_keep()); - if (! query) - throw_(std::runtime_error, - _("Invalid query predicate: %1") << join_args(args)); + if (query) { + call_scope_t sub_args(static_cast<scope_t&>(args)); + sub_args.push_back(string_value(query.text())); - call_scope_t sub_args(static_cast<scope_t&>(args)); - sub_args.push_back(string_value(query.text())); - - parse_command(sub_args); + parse_command(sub_args); + } if (query.tokens_remaining()) { out << std::endl << _("====== Display predicate ======") @@ -199,14 +197,12 @@ value_t args_command(call_scope_t& args) query.parse_again(); - if (! query) - throw_(std::runtime_error, - _("Invalid display predicate: %1") << join_args(args)); + if (query) { + call_scope_t disp_sub_args(static_cast<scope_t&>(args)); + disp_sub_args.push_back(string_value(query.text())); - call_scope_t disp_sub_args(static_cast<scope_t&>(args)); - disp_sub_args.push_back(string_value(query.text())); - - parse_command(disp_sub_args); + parse_command(disp_sub_args); + } } return NULL_VALUE; |