]> git.donarmstrong.com Git - mothur.git/blobdiff - getsabundcommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / getsabundcommand.cpp
index 3637d2903112154c6af122e1bac68a2a0ab65f1a..2ae807c65c7d9f4ec814564fb5823ccd3f925471 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetSAbundCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetSAbundCommand::GetSAbundCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["sabund"] = tempOutNames;
        }
@@ -61,12 +60,12 @@ vector<string> GetSAbundCommand::getRequiredFiles(){
 GetSAbundCommand::GetSAbundCommand(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
@@ -152,7 +151,7 @@ GetSAbundCommand::~GetSAbundCommand(){
 int GetSAbundCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                //using order vector so you don't have to distinguish between the list and rabund files
                read = new ReadOTUFile(globaldata->inputFileName);