From 2a291e6868f43ffe0f2068f51b12bbea3152eb55 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 3 May 2012 07:24:27 +0000 Subject: [PATCH] add an eval command which send it's arguments to the command evaluator --- src/main.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.cc b/src/main.cc index f5f78e61a..0fa6d8795 100644 --- a/src/main.cc +++ b/src/main.cc @@ -917,6 +917,12 @@ void exec_string(const CommandParameters& params, exec_keys(keys, context); } +void eval_string(const CommandParameters& params, + const Context& context) +{ + CommandManager::instance().execute(params, context); +} + void run_unit_tests(); int main(int argc, char* argv[]) @@ -1000,6 +1006,7 @@ int main(int argc, char* argv[]) command_manager.register_command("runtime", exec_commands_in_runtime_file); command_manager.register_command("exec", exec_string); + command_manager.register_command("eval", eval_string); command_manager.register_command("def", define_command, CommandManager::IgnoreSemiColons | CommandManager::DeferredShellEval); command_manager.register_command("echo", echo_message);