Shell: Implemented the 'exec' (or '!') command

This commit is contained in:
Paul Beckingham 2015-10-18 00:18:05 -04:00
parent d3410d8dcd
commit 766e16d22a
4 changed files with 17 additions and 13 deletions

View file

@ -27,16 +27,20 @@
#include <cmake.h>
#include <vector>
#include <string>
#include <stdlib.h>
#include <text.h>
////////////////////////////////////////////////////////////////////////////////
int cmdShell ()
int cmdShell (const std::vector <std::string>& args)
{
/*
auto status = execute ("task",
{"_get", "rc.uda.reviewed.type"},
input,
output);
*/
std::string combined;
join (combined, " ", args);
// Support '!ls' as well as '! ls'.
if (combined[0] == '!')
combined = combined.substr (1);
system (combined.c_str ());
return 0;
}