From da7fc3311fba98bde4fbc3457fdbf2503fd2b4d0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 22 Oct 2015 13:59:23 +0100 Subject: Pass ShellContext to commands Fix #427 --- src/command_manager.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/command_manager.cc') diff --git a/src/command_manager.cc b/src/command_manager.cc index 8c3a6454..0c8613f2 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -405,6 +405,7 @@ CommandManager::find_command(const Context& context, const String& name) const void CommandManager::execute_single_command(CommandParameters params, Context& context, + const ShellContext& shell_context, CharCoord pos) const { if (params.empty()) @@ -419,7 +420,7 @@ void CommandManager::execute_single_command(CommandParameters params, { ParametersParser parameter_parser(param_view, command_it->second.param_desc); - command_it->second.command(parameter_parser, context); + command_it->second.command(parameter_parser, context, shell_context); } catch (runtime_error& error) { @@ -444,7 +445,7 @@ void CommandManager::execute(StringView command_line, if (it->type() == Token::Type::CommandSeparator) { - execute_single_command(params, context, command_coord); + execute_single_command(params, context, shell_context, command_coord); params.clear(); } // Shell expand are retokenized @@ -464,7 +465,7 @@ void CommandManager::execute(StringView command_line, else params.push_back(expand_token(*it, context, shell_context)); } - execute_single_command(params, context, command_coord); + execute_single_command(params, context, shell_context, command_coord); } CommandInfo CommandManager::command_info(const Context& context, StringView command_line) const -- cgit v1.2.3