X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothur.cpp;h=ab4fea0e09482b3c8c988ade3e244fa4c8504750;hb=c99f3846e7a7b6f06ab46508baa5409204ad6290;hp=2d8f2f4bb0b234076d94c1e5845823b6d75fdc2f;hpb=f81efc0c56f3be9ff2ee32a9a9469e07b4cb3bee;p=mothur.git diff --git a/mothur.cpp b/mothur.cpp index 2d8f2f4..ab4fea0 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -14,13 +14,17 @@ /**************************************************************************************************/ GlobalData* GlobalData::_uniqueInstance = 0; +CommandFactory* CommandFactory::_uniqueInstance = 0; int main(int argc, char *argv[]){ try { //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) @@ -41,9 +45,9 @@ int main(int argc, char *argv[]){ //header - mothurOut("mothur v.1.7.0"); + mothurOut("mothur v.1.7.2"); mothurOutEndLine(); - mothurOut("Last updated: 11/23/2009"); + mothurOut("Last updated: 12/04/2009"); mothurOutEndLine(); mothurOutEndLine(); mothurOut("by"); @@ -58,7 +62,11 @@ int main(int argc, char *argv[]){ mothurOut("pschloss@umich.edu"); mothurOutEndLine(); mothurOut("http://www.mothur.org"); - mothurOutEndLine(); + 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"); @@ -73,7 +81,7 @@ int main(int argc, char *argv[]){ //srand(54321); srand( (unsigned)time( NULL ) ); - + Engine* mothur; bool bail = 0; string input; @@ -88,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) {