]> git.donarmstrong.com Git - mothur.git/blobdiff - engine.cpp
added warning about merging with something above cutoff to cluster. working on chimeras
[mothur.git] / engine.cpp
index c6ade387da83e0ebbdcf67addd28f99e7267a500..18e1a595c06343a521d9bcd6458b95db4d863db7 100644 (file)
 
 #include "engine.hpp"
 
-/***********************************************************************/
-inline void terminateCommand(int dummy)  {
-       
-               //mothurOut("Stopping command...."); 
-               //CommandFactory* cFactory = CommandFactory::getInstance();
-               //cFactory->getCommand();  //deletes old command and makes new no command.  
-                                                               //this may cause memory leak if old commands execute function allocated memory 
-                                                               //that is freed in the execute function and not the deconstructor 
-               //mothurOut("DONE."); mothurOutEndLine();
-}
 /***********************************************************************/
 Engine::Engine(){
        try {
@@ -96,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