]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.cpp
finished consensus.seqs cutoff change
[mothur.git] / mothur.cpp
index 45be11d8adbb0a74fa5412298e803991f1877fd9..b551302646c10b813740516eaa65cc46453b4a1d 100644 (file)
@@ -9,7 +9,6 @@
  
 #include "mothur.h"
 #include "engine.hpp"
-#include "globaldata.hpp"
 #include "mothurout.h"
 
 /**************************************************************************************************/
@@ -79,13 +78,14 @@ int main(int argc, char *argv[]){
                m->setVersion(mothurVersion);
                
                //will make the gui output "pretty"
-               bool guiMode = false;
+               bool outputHeader = true;
                if (argc>1) {
                        string guiInput = argv[1];
-                       if (guiInput[0] == '+') { guiMode = true; }
+                       if (guiInput[0] == '+') { outputHeader = false; }
+                       if (guiInput[0] == '-') { outputHeader = false; }
                }
                
-               if (!guiMode) {
+               if (outputHeader)  {
                        //version
                        #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                                #if defined (__APPLE__) || (__MACH__)
@@ -162,13 +162,13 @@ int main(int argc, char *argv[]){
                //srand(54321);
                srand( (unsigned)time( NULL ) );
                
-               Engine* mothur;
+               Engine* mothur = NULL;
                bool bail = 0;
                string input;
  
                if(argc>1){
                        input = argv[1];
-                       m->mothurOut("input = " + input); m->mothurOutEndLine();
+                       //m->mothurOut("input = " + input); m->mothurOutEndLine();
 
                        if (input[0] == '#') {
                                m->mothurOutJustToLog("Script Mode");
@@ -178,6 +178,12 @@ int main(int argc, char *argv[]){
                        }else if (input[0] == '+') {
                                        mothur = new ScriptEngine(argv[0], argv[1]);
                                        m->gui = true;
+                       }else if (input == "-version") {
+                               m->mothurOut("Mothur version=" + mothurVersion + "\nRelease Date=" + releaseDate); m->mothurOutEndLine(); m->mothurOutEndLine(); m->closeLog();
+                               #ifdef USE_MPI
+                                       MPI_Finalize();
+                               #endif
+                               return 0;
                        }else{
                                m->mothurOutJustToLog("Batch Mode");
                                m->mothurOutEndLine(); m->mothurOutEndLine();
@@ -215,6 +221,8 @@ int main(int argc, char *argv[]){
                                
                                if (!m->gui) {
                                        outNewLog << endl << endl << "*********************************************************************************" << endl << endl;
+                               }else {
+                                       outNewLog << endl;
                                }
                                outNewLog.close();
                                
@@ -228,7 +236,7 @@ int main(int argc, char *argv[]){
                }
                
                                
-               delete mothur;
+               if (mothur != NULL) { delete mothur; }
                
                #ifdef USE_MPI
                        MPI_Finalize();