+/***********************************************************************/
+string Engine::getCommand() {
+ try {
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #ifdef USE_READLINE
+ char* nextCommand = NULL;
+ nextCommand = readline("mothur > ");
+
+ if(nextCommand != NULL) { add_history(nextCommand); }
+ else{ //^D causes null string and we want it to quit mothur
+ nextCommand = "quit";
+ cout << nextCommand << endl;
+ }
+
+ #ifdef USE_MPI
+ int pid;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+
+ if (pid == 0) { //only one process should output to screen
+ #endif
+
+ mout->mothurOutJustToLog("mothur > " + toString(nextCommand));
+
+ #ifdef USE_MPI
+ }
+ #endif
+
+ return nextCommand;
+ #else
+ string nextCommand = "";
+ #ifdef USE_MPI
+ int pid;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+
+ if (pid == 0) { //only one process should output to screen
+ #endif
+
+ mout->mothurOut("mothur > ");
+
+ #ifdef USE_MPI
+ }
+ #endif
+
+ getline(cin, nextCommand);
+
+ #ifdef USE_MPI
+ int pid;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+
+ if (pid == 0) { //only one process should output to screen
+ #endif
+
+ mout->mothurOutJustToLog("mothur > " + toString(nextCommand));
+
+ #ifdef USE_MPI
+ }
+ #endif
+
+ return nextCommand;
+ #endif
+ #else
+ string nextCommand = "";
+ #ifdef USE_MPI
+ int pid;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+
+ if (pid == 0) { //only one process should output to screen
+ #endif
+
+ mout->mothurOut("mothur > ");
+
+ #ifdef USE_MPI
+ }
+ #endif
+
+ getline(cin, nextCommand);
+
+ #ifdef USE_MPI
+ int pid;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+
+ if (pid == 0) { //only one process should output to screen
+ #endif
+
+ mout->mothurOutJustToLog(toString(nextCommand));
+
+ #ifdef USE_MPI
+ }
+ #endif