Moved --pager handler back into report_t.

This commit is contained in:
John Wiegley 2009-02-05 21:54:46 -04:00
parent 408b819c6e
commit d853a58f5f
5 changed files with 8 additions and 13 deletions

View file

@ -169,9 +169,12 @@ void global_scope_t::execute_command(strings_list args, bool at_repl)
// by the caller of this function.
report().output_stream
.initialize(report().HANDLER(output_) ?
.initialize(report().HANDLED(output_) ?
optional<path>(path(report().HANDLER(output_).str())) :
optional<path>(), session().pager_path);
optional<path>(),
report().HANDLED(pager_) ?
optional<path>(path(report().HANDLER(pager_).str())) :
optional<path>());
// Create an argument scope containing the report command's arguments, and
// then invoke the command. The bound scope causes lookups to happen

View file

@ -344,6 +344,7 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
else OPT(period_sort_);
else OPT(price);
else OPT(price_db_);
else OPT(pager_);
break;
case 'q':

View file

@ -188,6 +188,7 @@ public:
COPY_OPT(monthly, other),
COPY_OPT(output_, other),
COPY_OPT(output_date_format_, other),
COPY_OPT(pager_, other),
COPY_OPT(period_, other),
COPY_OPT(period_sort_, other),
COPY_OPT(price, other),
@ -269,6 +270,7 @@ public:
OPTION(report_t, monthly);
OPTION(report_t, output_);
OPTION(report_t, output_date_format_);
OPTION(report_t, pager_);
OPTION(report_t, period_);
OPTION(report_t, period_sort_);
OPTION(report_t, price);

View file

@ -354,11 +354,6 @@ expr_t::ptr_op_t session_t::lookup(const string& name)
return MAKE_FUNCTOR(session_t::option_file_);
break;
case 'p':
if (std::strcmp(p, "pager_") == 0)
return MAKE_FUNCTOR(session_t::option_pager_);
break;
case 't':
if (std::strcmp(p, "trace_") == 0)
return MAKE_FUNCTOR(session_t::option_trace_);

View file

@ -69,7 +69,6 @@ public:
bool saw_data_file_from_command_line;
optional<path> init_file;
optional<path> price_db;
optional<path> pager_path;
bool next_price_db_from_command_line;
bool saw_price_db_from_command_line;
@ -230,11 +229,6 @@ See LICENSE file included with the distribution for details and disclaimer.";
data_files.push_back(args[0].as_string());
return true;
}
value_t option_pager_(call_scope_t& args) { // :
pager_path = args[0].as_string();
return true;
}
};
/**