]> git.donarmstrong.com Git - mothur.git/blobdiff - engine.cpp
working on chimeras
[mothur.git] / engine.cpp
index 593c2c3128d08cfe8abddfa81a1e384a1d17aa62..18e1a595c06343a521d9bcd6458b95db4d863db7 100644 (file)
@@ -86,19 +86,27 @@ string Engine::getCommand()  {
                        #ifdef USE_READLINE
                                char* nextCommand = NULL;
                                nextCommand = readline("mothur > ");
-                               if(nextCommand != NULL) {  add_history(nextCommand);  }         
+                               
+                               if(nextCommand != NULL) {  add_history(nextCommand);  } 
+                               else{ //^D causes null string and we want it to quit mothur
+                                       nextCommand = "quit"; 
+                                       cout << nextCommand << endl;
+                               }       
+                               
                                mothurOutJustToLog("mothur > " + toString(nextCommand));
                                return nextCommand;
                        #else
                                string nextCommand = "";
                                mothurOut("mothur > ");
                                getline(cin, nextCommand);
+                               mothurOutJustToLog("mothur > " + toString(nextCommand));
                                return nextCommand;
                        #endif
                #else
                        string nextCommand = "";
                        mothurOut("mothur > ");
                        getline(cin, nextCommand);
+                       mothurOutJustToLog("mothur > " + toString(nextCommand));
                        return nextCommand;
                #endif