]> git.donarmstrong.com Git - mothur.git/blobdiff - rarefactsharedcommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / rarefactsharedcommand.cpp
index 8cf1f2fd6606f97bed2e10d0301994d769a8aa94..ea460c026e4c4ea77684893920b328288d3f9f63 100644 (file)
@@ -26,8 +26,7 @@ vector<string> RareFactSharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 RareFactSharedCommand::RareFactSharedCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["sharedrarefaction"] = tempOutNames;
                outputTypes["sharedr_nseqs"] = tempOutNames;
@@ -66,14 +65,14 @@ RareFactSharedCommand::RareFactSharedCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
                
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Estimators.clear();
                Groups.clear();
                                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -217,7 +216,7 @@ RareFactSharedCommand::~RareFactSharedCommand(){
 int RareFactSharedCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //if the users entered no valid calculators don't execute command
                if (rDisplays.size() == 0) { return 0; }