]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.cpp
version working on mac with .tellg changed to unget for windows
[mothur.git] / mothur.cpp
index 3a91aa6e595393111416cf04b367af0a8ca38e6f..59837dd72d7dc8dbe76ee3125052461a9e7b580a 100644 (file)
 #include "engine.hpp"
 #include "globaldata.hpp"
 
-using namespace std;
+/**************************************************************************************************/
 
 GlobalData* GlobalData::_uniqueInstance = 0;
 
 int main(int argc, char *argv[]){
        try {
-       //      srand(54321);
+               //srand(54321);
                srand( (unsigned)time( NULL ) );
 
-               Engine* dotur;
+               Engine* mothur;
                bool bail = 0;
+               string input;
 
                if(argc>1){
-                       dotur = new BatchEngine(argv[1]);
+                       input = argv[1];
+
+                       if (input[0] == '#') {
+                               mothur = new ScriptEngine(argv[0], argv[1]);
+                       }else{
+                               mothur = new BatchEngine(argv[0], argv[1]);
+                       }
                }
                else{
-                       dotur = new InteractEngine();           
+                       mothur = new InteractEngine(argv[0]);           
                }
 
-               while(bail == 0)                {       bail = dotur->getInput();                       }
+               while(bail == 0)                {       bail = mothur->getInput();                      }
        
-               delete dotur;
+               delete mothur;
        
                return 0;
        }
@@ -46,3 +53,5 @@ int main(int argc, char *argv[]){
        }
 }
 
+/**************************************************************************************************/
+