//break apart path variable by ':'
vector<string> dirs;
- splitAtChar(envPath, dirs, delim);
+ mout->splitAtChar(envPath, dirs, delim);
//get path related to mothur
string mothurPath = "";
//executes valid command
Command* command = cFactory->getCommand(commandName, options);
quitCommandCalled = command->execute();
+
+ //if we aborted command
+ if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
mout->control_pressed = 0;
mout->executing = false;
if(nextCommand != NULL) { add_history(nextCommand); }
else{ //^D causes null string and we want it to quit mothur
- nextCommand = "quit";
+ strcpy(nextCommand, "quit");
mout->mothurOut(nextCommand);
}
try {
globaldata = GlobalData::getInstance();
- openedBatch = openInputFile(batchFileName, inputBatchFile);
+ openedBatch = mout->openInputFile(batchFileName, inputBatchFile);
string temppath = path.substr(0, (path.find_last_of('m')));
//break apart path variable by ':'
vector<string> dirs;
- splitAtChar(envPath, dirs, delim);
+ mout->splitAtChar(envPath, dirs, delim);
//get path related to mothur
string mothurPath = "";
//CommandFactory cFactory;
int quitCommandCalled = 0;
int count = 0;
- while(quitCommandCalled == 0){
+ while(quitCommandCalled != 1){
#ifdef USE_MPI
int pid, processors;
//executes valid command
Command* command = cFactory->getCommand(commandName, options);
quitCommandCalled = command->execute();
+
+ //if we aborted command
+ if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
mout->control_pressed = 0;
mout->executing = false;
}
}
- gobble(inputBatchFile);
+ mout->gobble(inputBatchFile);
}
inputBatchFile.close();
string nextcommand = "";
if (inputBatchFile.eof()) { nextcommand = "quit()"; }
- else { nextcommand = getline(inputBatchFile); }
+ else { nextcommand = mout->getline(inputBatchFile); }
return nextcommand;
}
//break apart path variable by ':'
vector<string> dirs;
- splitAtChar(envPath, dirs, delim);
+ mout->splitAtChar(envPath, dirs, delim);
//get path related to mothur
string mothurPath = "";
//CommandFactory cFactory;
int quitCommandCalled = 0;
- while(quitCommandCalled == 0){
+ while(quitCommandCalled != 1){
#ifdef USE_MPI
int pid, processors;
mout->executing = true;
#ifdef USE_MPI
int pid, numProcesses;
- MPI_Status status;
MPI_Comm_rank(MPI_COMM_WORLD, &pid);
MPI_Comm_size(MPI_COMM_WORLD, &numProcesses);
//executes valid command
Command* command = cFactory->getCommand(commandName, options);
quitCommandCalled = command->execute();
+
+ //if we aborted command
+ if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
mout->control_pressed = 0;
mout->executing = false;
string nextcommand = "";
int count = 0;
+ bool ignoreSemiColons = false;
//go through string until you reach ; or end
while (count < commandString.length()) {
- if (commandString[count] == ';') { break; }
+ //you want to ignore any ; until you reach the next '
+ if ((commandString[count] == '\'') && (!ignoreSemiColons)) { ignoreSemiColons = true; }
+ else if ((commandString[count] == '\'') && (ignoreSemiColons)) { ignoreSemiColons = false; }
+
+ if ((commandString[count] == ';') && (!ignoreSemiColons)) { break; }
else { nextcommand += commandString[count]; }
count++;