query command's parsing behavior sensitive to -n

With -n, the first argument is parsed as a string containing
subarguments.  Otherwise, each argument is parsed as a separate
argument.

In short, the -n mode mimicks what happens when the query expr after "="
is parsed for automated expressions.  The non -n mode mimicks what
happens at the command line for users.
This commit is contained in:
John Wiegley 2010-06-19 14:02:33 -04:00
parent 627162acc0
commit 9b905f2b44

View file

@ -200,7 +200,8 @@ value_t query_command(call_scope_t& args)
args.value().dump(out);
out << std::endl << std::endl;
query_t query(args.value(), report.what_to_keep());
query_t query(args.value(), report.what_to_keep(),
! report.HANDLED(collapse));
if (query) {
call_scope_t sub_args(static_cast<scope_t&>(args));
sub_args.push_back(string_value(query.text()));