summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.cpp17
-rw-r--r--src/commands.h2
-rw-r--r--src/gui/chatwindow.cpp1
3 files changed, 20 insertions, 0 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index dce8c57e0..abd30f713 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1056,6 +1056,23 @@ impHandler1(open)
openBrowser(url);
}
+impHandler1(execute)
+{
+ const size_t idx = args.find(" ");
+ std::string name;
+ std::string params;
+ if (idx == std::string::npos)
+ {
+ name = args;
+ }
+ else
+ {
+ name = args.substr(0, idx);
+ params = args.substr(idx + 1);
+ }
+ execFile(name, name, params, "");
+}
+
#ifdef DEBUG_DUMP_LEAKS1
void showRes(std::string str, ResourceManager::Resources *res);
diff --git a/src/commands.h b/src/commands.h
index b0e3b6951..7d1cf80e1 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -113,6 +113,7 @@ namespace Commands
decHandler(dumpTests);
decHandler(dumpOGL);
decHandler(cacheInfo);
+ decHandler(execute);
void replaceVars(std::string &str);
}
@@ -190,6 +191,7 @@ static const CommandInfo commands[] =
{"dumpogl", &Commands::dumpOGL},
{"url", &Commands::url},
{"open", &Commands::open},
+ {"execute", &Commands::execute},
{"hack", &Commands::hack}
};
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 59da87d37..9d8739ddb 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -295,6 +295,7 @@ void ChatWindow::fillCommands()
mCommands.push_back("/close");
mCommands.push_back("/cacheinfo");
mCommands.push_back("/erase ");
+ mCommands.push_back("/execute ");
mCommands.push_back("/follow ");
mCommands.push_back("/heal ");
mCommands.push_back("/ignoreall");