5 * Created by Pat Schloss on 8/14/08.
6 * Copyright 2008 Patrick D. Schloss. All rights reserved.
12 #include "globaldata.hpp"
14 /**************************************************************************************************/
16 GlobalData* GlobalData::_uniqueInstance = 0;
17 CommandFactory* CommandFactory::_uniqueInstance = 0;
19 int main(int argc, char *argv[]){
23 string log = "mothur.logFile";
26 time_t ltime = time(NULL); /* calendar time */
27 string logFileName = "mothur." + toString(asctime( localtime(<ime) )) + ".logfile";
30 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
32 #if defined (__APPLE__) || (__MACH__)
33 mothurOutJustToLog("Mac version");
34 mothurOutEndLine(); mothurOutEndLine();
36 mothurOutJustToLog("Linux version");
37 mothurOutEndLine(); mothurOutEndLine();
42 mothurOutJustToLog("Windows version");
43 mothurOutEndLine(); mothurOutEndLine();
48 mothurOut("mothur v.1.7.2");
50 mothurOut("Last updated: 12/04/2009");
55 mothurOut("Patrick D. Schloss");
58 mothurOut("Department of Microbiology & Immunology");
60 mothurOut("University of Michigan");
62 mothurOut("pschloss@umich.edu");
64 mothurOut("http://www.mothur.org");
67 mothurOut("When using, please cite:");
69 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.");
72 mothurOut("Distributed under the GNU General Public License");
75 mothurOut("Type 'help()' for information on the commands that are available");
78 mothurOut("Type 'quit()' to exit program");
83 srand( (unsigned)time( NULL ) );
92 if (input[0] == '#') {
93 mothur = new ScriptEngine(argv[0], argv[1]);
95 mothur = new BatchEngine(argv[0], argv[1]);
99 mothur = new InteractEngine(argv[0]);
102 //used to intercept the terminate signal, so instead of terminating mothur it will end a command
103 //void (*prev_fn)(int);
104 //prev_fn = signal(SIGTERM, mothur->terminateCommand(0));
106 //if (prev_fn==SIG_IGN) signal (SIGTERM,SIG_IGN);
109 while(bail == 0) { bail = mothur->getInput(); }
113 rename(log.c_str(), logFileName.c_str()); //logfile with timestamp
117 catch(exception& e) {
118 errorOut(e, "mothur", "main");
123 /**************************************************************************************************/