]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.cpp
pat's edits from 1/26/2010
[mothur.git] / mothur.cpp
index 0cd4faf1dcc3eec95d9cc05b39e32980fe88d5c4..ab4fea0e09482b3c8c988ade3e244fa4c8504750 100644 (file)
 /**************************************************************************************************/
 
 GlobalData* GlobalData::_uniqueInstance = 0;
+CommandFactory* CommandFactory::_uniqueInstance = 0;
 
 int main(int argc, char *argv[]){
        try {
                
-               system("clear");
-               
                //remove old logfile
-               string logFileName = "mothur.logFile";
-               remove(logFileName.c_str());
+//             string log = "mothur.logFile";
+//             remove(log.c_str());
+               
+               time_t ltime = time(NULL); /* calendar time */  
+               string logFileName = "mothur." + toString(ltime) + ".logfile";
                
                //version
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+                       system("clear");
                        #if defined (__APPLE__) || (__MACH__)
                                mothurOutJustToLog("Mac version");
                                mothurOutEndLine(); mothurOutEndLine();
@@ -35,15 +38,16 @@ int main(int argc, char *argv[]){
                        #endif
 
                #else
+                       system("CLS");
                        mothurOutJustToLog("Windows version");
                        mothurOutEndLine(); mothurOutEndLine();
                #endif          
 
                
                //header
-               mothurOut("mothur v.1.4.1");
+               mothurOut("mothur v.1.7.2");
                mothurOutEndLine();             
-               mothurOut("Last updated: 6/23/2009");
+               mothurOut("Last updated: 12/04/2009");
                mothurOutEndLine();     
                mothurOutEndLine();             
                mothurOut("by");
@@ -51,12 +55,18 @@ int main(int argc, char *argv[]){
                mothurOut("Patrick D. Schloss");
                mothurOutEndLine();
                mothurOutEndLine();                     
-               mothurOut("Department of Microbiology");
-               mothurOutEndLine();             
-               mothurOut("pschloss@micro.umass.edu");
-               mothurOutEndLine();             
-               mothurOut("http://schloss.micro.umass.edu/mothur");
+               mothurOut("Department of Microbiology & Immunology");
                mothurOutEndLine();     
+               mothurOut("University of Michigan");
+               mothurOutEndLine();                     
+               mothurOut("pschloss@umich.edu");
+               mothurOutEndLine();             
+               mothurOut("http://www.mothur.org");
+               mothurOutEndLine();
+               mothurOutEndLine();
+               mothurOut("When using, please cite:");
+               mothurOutEndLine();
+               mothurOut("Schloss, P.D., et al., Introducing mothur: Open-source, platform-independent, community-supported software for describing and comparing microbial communities. Appl Environ Microbiol, 2009. 75(23):7537-41.");
                mothurOutEndLine();     
                mothurOutEndLine();             
                mothurOut("Distributed under the GNU General Public License");
@@ -71,7 +81,7 @@ int main(int argc, char *argv[]){
                                
                //srand(54321);
                srand( (unsigned)time( NULL ) );
-
+               
                Engine* mothur;
                bool bail = 0;
                string input;
@@ -86,13 +96,22 @@ int main(int argc, char *argv[]){
                        }
                }
                else{
-                       mothur = new InteractEngine(argv[0]);           
+                       mothur = new InteractEngine(argv[0]);   
                }
+               
+               //used to intercept the terminate signal, so instead of terminating mothur it will end a command
+               //void (*prev_fn)(int);
+               //prev_fn = signal(SIGTERM, mothur->terminateCommand(0));
+               
+               //if (prev_fn==SIG_IGN) signal (SIGTERM,SIG_IGN);
 
+               
                while(bail == 0)                {       bail = mothur->getInput();                      }
        
                delete mothur;
-       
+               
+//             rename(log.c_str(), logFileName.c_str()); //logfile with timestamp
+               
                return 0;
        }
        catch(exception& e) {