globaldata = GlobalData::getInstance();
globaldata->argv = path;
- string logFileName = "mothur.logFile";
- remove(logFileName.c_str());
- system("clear");
+
}
/***********************************************************************/
string options = "";
int quitCommandCalled = 0;
- mothurOut("mothur v.1.4.1");
- mothurOutEndLine();
- mothurOut("Last updated: 6/23/2009");
- mothurOutEndLine();
- mothurOutEndLine();
- mothurOut("by");
- mothurOutEndLine();
- mothurOut("Patrick D. Schloss");
- mothurOutEndLine();
- mothurOutEndLine();
- mothurOut("Department of Microbiology");
- mothurOutEndLine();
- mothurOut("pschloss@micro.umass.edu");
- mothurOutEndLine();
- mothurOut("http://schloss.micro.umass.edu/mothur");
- mothurOutEndLine();
- mothurOutEndLine();
- mothurOutEndLine();
- mothurOut("Distributed under the GNU General Public License");
- mothurOutEndLine();
- mothurOutEndLine();
- mothurOut("Type 'help()' for information on the commands that are available");
- mothurOutEndLine();
- mothurOutEndLine();
- mothurOut("Type 'quit()' to exit program");
- mothurOutEndLine();
-
+
while(quitCommandCalled != 1){
mothurOutEndLine();
openedBatch = openInputFile(batchFileName, inputBatchFile);
globaldata->argv = path;
- string logFileName = "mothur.logFile";
- remove(logFileName.c_str());
-
- system("clear");
-
- // char buffer = ' ';
- // ifstream header("introtext.txt");
- // while(!header.eof()){
- // cout << buffer;
- // buffer = header.get();
- // }
+
}
catch(exception& e) {
errorOut(e, "BatchEngine", "BatchEngine");
while(quitCommandCalled == 0){
if (inputBatchFile.eof()) { input = "quit()"; }
- else { getline(inputBatchFile, input); }
-
-
+ else { input = getline(inputBatchFile); }
if (input[0] != '#') {
listOfCommands = commandString.substr(1, (commandString.length()-1));
globaldata->argv = path;
- string logFileName = "mothur.logFile";
- remove(logFileName.c_str());
-
- system("clear");
+
+
}
catch(exception& e) {
string ScriptEngine::getNextCommand(string& commandString) {
try {
string nextcommand = "";
+ int count = 0;
- nextcommand = commandString.substr(0,commandString.find_first_of(';'));
-
+ //go through string until you reach ; or end
+ while (count < commandString.length()) {
+
+ if (commandString[count] == ';') { break; }
+ else { nextcommand += commandString[count]; }
+
+ count++;
+ }
+
+ //if you are not at the end
+ if (count != commandString.length()) { commandString = commandString.substr(count+1, commandString.length()); }
+ else { commandString = ""; }
- if ((commandString.find_first_of(';')+1) <= commandString.length()) {
- commandString = commandString.substr(commandString.find_first_of(';')+1, commandString.length());
- }else { commandString = ""; } //you have reached the last command.
//get rid of spaces in between commands if any
if (commandString.length() > 0) {