aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/bruiser.cpp
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-05-18 18:39:49 +0000
committerbloodstalker <thabogre@gmail.com>2017-05-18 18:39:49 +0000
commit1578341f61da9b90a2b111091684c4ff90a7f460 (patch)
treeff85d4f4f45ae0a0d5d34bc48aeb71865d76e1b2 /bruiser/bruiser.cpp
parentadded a class for mutagen extraction (diff)
downloadmutator-1578341f61da9b90a2b111091684c4ff90a7f460.tar.gz
mutator-1578341f61da9b90a2b111091684c4ff90a7f460.zip
fixed the history command. now it prints the contents of the history file
Diffstat (limited to '')
-rw-r--r--bruiser/bruiser.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp
index b68884b..bb64a9b 100644
--- a/bruiser/bruiser.cpp
+++ b/bruiser/bruiser.cpp
@@ -2,7 +2,7 @@
/***************************************************Project Mutator****************************************************/
//-*-c++-*-
/*first line intentionally left blank.*/
-/*the source code for the mutator code breaker.*/
+/*the main for bruiser.*/
/*Copyright (C) 2017 Farzad Sadeghi
This program is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
#include "CompletionHints.h"
#include "../mutator_aux.h"
/*standard headers*/
+#include "fstream"
#include <string>
#include <cassert>
#include <iostream>
@@ -906,12 +907,26 @@ int main(int argc, const char **argv)
if (std::strcmp(command, "history") == 0)
{
+ std::ifstream historyfile;
+ historyfile.open(SHELL_HISTORY_FILE);
+
+ std::string tempstring;
+ unsigned int tempint = 0;
+ while(std::getline(historyfile, tempstring))
+ {
+ printf(GREEN"%d - %s", tempint, tempstring.c_str());
+ printf(NORMAL"\n");
+
+ tempint++;
+ }
+#if 0
unsigned int _cnt = 0;
for (auto &it : shHistory.History)
{
std::cout << _cnt << "." << it << "\n";
_cnt++;
}
+#endif
continue;
}