]> git.donarmstrong.com Git - mothur.git/blobdiff - getrelabundcommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / getrelabundcommand.cpp
index 08e9228b215819f5e19e4d697137384294392422..5e48203f87e11fe14f54033b966b0bbd55bdde60 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetRelAbundCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetRelAbundCommand::GetRelAbundCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["relabund"] = tempOutNames;
        }
@@ -61,12 +60,12 @@ vector<string> GetRelAbundCommand::getRequiredFiles(){
 GetRelAbundCommand::GetRelAbundCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //allow user to run help
-               if(option == "help") { help(); abort = true; }
+               if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -167,7 +166,7 @@ GetRelAbundCommand::~GetRelAbundCommand(){
 int GetRelAbundCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "relabund";
                ofstream out;