]> git.donarmstrong.com Git - mothur.git/blob - mothur.cpp
fixed bug in bootstrap command that was caused by globaldata's breakup, and made...
[mothur.git] / mothur.cpp
1 /*
2  *  interface.cpp
3  *  
4  *
5  *  Created by Pat Schloss on 8/14/08.
6  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
7  *
8  */
9  
10 #include "mothur.h"
11 #include "engine.hpp"
12 #include "globaldata.hpp"
13
14 /**************************************************************************************************/
15
16 GlobalData* GlobalData::_uniqueInstance = 0;
17
18 int main(int argc, char *argv[]){
19         try {
20                 
21                 system("clear");
22                 
23                 //remove old logfile
24                 string logFileName = "mothur.logFile";
25                 remove(logFileName.c_str());
26                 
27                 //version
28                 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
29                         #if defined (__APPLE__) || (__MACH__)
30                                 mothurOutJustToLog("Mac version");
31                                 mothurOutEndLine(); mothurOutEndLine();
32                         #else
33                                 mothurOutJustToLog("Linux version");
34                                 mothurOutEndLine(); mothurOutEndLine();
35                         #endif
36
37                 #else
38                         mothurOutJustToLog("Windows version");
39                         mothurOutEndLine(); mothurOutEndLine();
40                 #endif          
41
42                 
43                 //header
44                 mothurOut("mothur v.1.4.1");
45                 mothurOutEndLine();             
46                 mothurOut("Last updated: 6/23/2009");
47                 mothurOutEndLine();     
48                 mothurOutEndLine();             
49                 mothurOut("by");
50                 mothurOutEndLine();             
51                 mothurOut("Patrick D. Schloss");
52                 mothurOutEndLine();
53                 mothurOutEndLine();                     
54                 mothurOut("Department of Microbiology");
55                 mothurOutEndLine();             
56                 mothurOut("pschloss@micro.umass.edu");
57                 mothurOutEndLine();             
58                 mothurOut("http://schloss.micro.umass.edu/mothur");
59                 mothurOutEndLine();     
60                 mothurOutEndLine();     
61                 mothurOutEndLine();             
62                 mothurOut("Distributed under the GNU General Public License");
63                 mothurOutEndLine();
64                 mothurOutEndLine();                     
65                 mothurOut("Type 'help()' for information on the commands that are available");
66                 mothurOutEndLine();
67                 mothurOutEndLine();                     
68                 mothurOut("Type 'quit()' to exit program");
69                 mothurOutEndLine();     
70
71                                 
72                 //srand(54321);
73                 srand( (unsigned)time( NULL ) );
74
75                 Engine* mothur;
76                 bool bail = 0;
77                 string input;
78
79                 if(argc>1){
80                         input = argv[1];
81
82                         if (input[0] == '#') {
83                                 mothur = new ScriptEngine(argv[0], argv[1]);
84                         }else{
85                                 mothur = new BatchEngine(argv[0], argv[1]);
86                         }
87                 }
88                 else{
89                         mothur = new InteractEngine(argv[0]);           
90                 }
91
92                 while(bail == 0)                {       bail = mothur->getInput();                      }
93         
94                 delete mothur;
95         
96                 return 0;
97         }
98         catch(exception& e) {
99                 errorOut(e, "mothur", "main");
100                 exit(1);
101         }
102 }
103
104 /**************************************************************************************************/
105