]> git.donarmstrong.com Git - mothur.git/blobdiff - mergefilecommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / mergefilecommand.cpp
index c7e5b65e06b77107251b9f4164f4f722edaaeeb2..2b34a00b8c3961d581032dcf6b6929404428a3b4 100644 (file)
@@ -24,8 +24,7 @@ vector<string> MergeFileCommand::getValidParameters(){
 //**********************************************************************************************************************
 MergeFileCommand::MergeFileCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["merge"] = tempOutNames;
        }
@@ -61,11 +60,11 @@ vector<string> MergeFileCommand::getRequiredFiles(){
 
 MergeFileCommand::MergeFileCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                
                if(option == "help") {
                        help();
-                       abort = true; 
+                       abort = true; calledHelp = true;
                }
                else {
                        //valid paramters for this command
@@ -137,7 +136,7 @@ MergeFileCommand::~MergeFileCommand()       {       /*      do nothing      */      }
 
 int MergeFileCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                ofstream outputFile;
                m->openOutputFile(outputFileName, outputFile);