]> git.donarmstrong.com Git - mothur.git/blob - mothur.cpp
added logfile feature
[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                 //srand(54321);
21                 srand( (unsigned)time( NULL ) );
22
23                 Engine* mothur;
24                 bool bail = 0;
25                 string input;
26
27                 if(argc>1){
28                         input = argv[1];
29
30                         if (input[0] == '#') {
31                                 mothur = new ScriptEngine(argv[0], argv[1]);
32                         }else{
33                                 mothur = new BatchEngine(argv[0], argv[1]);
34                         }
35                 }
36                 else{
37                         mothur = new InteractEngine(argv[0]);           
38                 }
39
40                 while(bail == 0)                {       bail = mothur->getInput();                      }
41         
42                 delete mothur;
43         
44                 return 0;
45         }
46         catch(exception& e) {
47                 errorOut(e, "mothur", "main");
48                 exit(1);
49         }
50 }
51
52 /**************************************************************************************************/
53