diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-08 02:24:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-08 02:24:24 +0300 |
commit | dcd0d2e4d8a827d06a10344855d8d044bd26630d (patch) | |
tree | d80a5c0f9e9ef9025b42ed7a619fbf21f4a867d7 /src/commands.cpp | |
parent | 466b8491acd56454d82ab70d3fcbc06206b18e6a (diff) | |
download | manaverse-dcd0d2e4d8a827d06a10344855d8d044bd26630d.tar.gz manaverse-dcd0d2e4d8a827d06a10344855d8d044bd26630d.tar.bz2 manaverse-dcd0d2e4d8a827d06a10344855d8d044bd26630d.tar.xz manaverse-dcd0d2e4d8a827d06a10344855d8d044bd26630d.zip |
Add chat command for execute external programs.
New chat command: /execute NAME[ PAR]
NAME - program name
PAR - parameter
Diffstat (limited to 'src/commands.cpp')
-rw-r--r-- | src/commands.cpp | 17 |
1 files changed, 17 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); |