//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);
}
string nextCommand = "";
mout->mothurOut("mothur > ");
- m->getline(cin, nextCommand);
+ getline(cin, nextCommand);
mout->mothurOutJustToLog(toString(nextCommand));
return nextCommand;
//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;
//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++;