X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothur.cpp;h=0314331287f0de7c466dc5cb4aacedece62fd56a;hb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2;hp=add60fa22f5c9a95137b651cf694dd6f27132ad7;hpb=36a8526766106bce1412e530e99f9c699dd59105;p=mothur.git diff --git a/mothur.cpp b/mothur.cpp index add60fa..0314331 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -11,8 +11,6 @@ #include "engine.hpp" #include "globaldata.hpp" -using namespace std; - /**************************************************************************************************/ GlobalData* GlobalData::_uniqueInstance = 0; @@ -24,9 +22,16 @@ int main(int argc, char *argv[]){ Engine* mothur; bool bail = 0; + string input; if(argc>1){ - mothur = new BatchEngine(argv[0], argv[1]); + input = argv[1]; + + if (input[0] == '#') { + mothur = new ScriptEngine(argv[0], argv[1]); + }else{ + mothur = new BatchEngine(argv[0], argv[1]); + } } else{ mothur = new InteractEngine(argv[0]); @@ -39,11 +44,7 @@ int main(int argc, char *argv[]){ return 0; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the dotur class Function main. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the dotur class function main. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + errorOut(e, "mothur", "main"); exit(1); } }