aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-05-01 23:33:55 +0000
committerbloodstalker <thabogre@gmail.com>2017-05-01 23:33:55 +0000
commit94bf3af4991f0097bd13f3d8ae2989d7202c48c1 (patch)
tree1d8ac55116cfbbc4f825be1d424c497b9f47e6e0 /bruiser
parentchanged inclusion directive from ncurses/curses.h to curses.h (diff)
downloadmutator-94bf3af4991f0097bd13f3d8ae2989d7202c48c1.tar.gz
mutator-94bf3af4991f0097bd13f3d8ae2989d7202c48c1.zip
history..., well sorta
Diffstat (limited to '')
-rw-r--r--bruiser/bruiser.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp
index 1398f9a..7b6ddc3 100644
--- a/bruiser/bruiser.cpp
+++ b/bruiser/bruiser.cpp
@@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
/*standard headers*/
#include <string>
#include <iostream>
+#include <regex>
/*LLVM headers*/
#include "clang/AST/AST.h"
#include "clang/AST/ASTConsumer.h"
@@ -333,6 +334,7 @@ int main(int argc, const char **argv)
std::cin.getline(command, sizeof(command));
shHistory.History.push_back(command);
#if defined(__DBG_1)
+ std::cout << InKey << "\n";
std::cout << shHistory.History.size() << "\n";
std::cout << shHistory.History.capacity() << "\n";
#endif
@@ -350,7 +352,6 @@ int main(int argc, const char **argv)
if (std::strcmp(command, "exit") == 0 || std::strcmp(command, "quit") == 0)
{
return 0;
- continue;
}
if (std::strcmp(command, "m0") == 0)
@@ -398,7 +399,7 @@ int main(int argc, const char **argv)
if (std::strcmp(command, "shell") == 0)
{
- system("bash -t");
+ system("bash -i");
continue;
}
@@ -408,9 +409,27 @@ int main(int argc, const char **argv)
continue;
}
+ if (std::strcmp(command, "history") == 0)
+ {
+ unsigned int _cnt = 0;
+ for (auto &it : shHistory.History)
+ {
+ _cnt++;
+ std::cout << _cnt << "." << it << "\n";
+ }
+
+ continue;
+ }
+
+ if (command[0] == '!')
+ {
+ std::cout << BROWN << "not implemented yet.\n" << NORMAL;
+ continue;
+ }
+
std::cout << RED << "unknown command. run help.\n" << NORMAL;
}
}
}
-/*last line interntionally left blank.*/
+/*last line intentionally left blank.*/