diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/report.cc | 10 | ||||
-rw-r--r-- | src/report.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/report.cc b/src/report.cc index 9c8ad8ba..34231b5c 100644 --- a/src/report.cc +++ b/src/report.cc @@ -408,6 +408,14 @@ value_t report_t::reload_command(call_scope_t&) return true; } +value_t report_t::echo_command(call_scope_t& scope) +{ + interactive_t args(scope, "s"); + std::ostream& out(output_stream); + out << args.get<string>(0) << std::endl; + return true; +} + bool report_t::maybe_import(const string& module) { if (lookup(string(OPT_PREFIX) + "import_")) { @@ -710,6 +718,8 @@ expr_t::ptr_op_t report_t::lookup(const string& name) else if (is_eq(q, "emacs")) return WRAP_FUNCTOR (reporter<>(new format_emacs_posts(output_stream), *this, "#emacs")); + else if (is_eq(q, "echo")) + return MAKE_FUNCTOR(report_t::echo_command); break; case 'p': diff --git a/src/report.h b/src/report.h index 5921a154..f0052128 100644 --- a/src/report.h +++ b/src/report.h @@ -178,6 +178,7 @@ public: } value_t reload_command(call_scope_t&); + value_t echo_command(call_scope_t& scope); keep_details_t what_to_keep() { bool lots = HANDLED(lots) || HANDLED(lots_actual); |