]> git.donarmstrong.com Git - mothur.git/blobdiff - getrabundcommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / getrabundcommand.cpp
index 60f4ece3eb13de6fc68f6141c3e28ca283da694b..0b2d4ee3ed0de4daf04da29b9ad5a3595143c4b1 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetRAbundCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetRAbundCommand::GetRAbundCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["rabund"] = tempOutNames;
        }
@@ -62,12 +61,12 @@ vector<string> GetRAbundCommand::getRequiredFiles(){
 GetRAbundCommand::GetRAbundCommand(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
@@ -158,7 +157,7 @@ GetRAbundCommand::~GetRAbundCommand(){}
 int GetRAbundCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //read first line
                read = new ReadOTUFile(globaldata->inputFileName);