]> git.donarmstrong.com Git - mothur.git/blobdiff - metastatscommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / metastatscommand.cpp
index 81715e0abe84b485b96eb9997120dbe127dd6a5e..e13e37c92c3103a3aabd1a4a6a7c68db443592ef 100644 (file)
@@ -26,8 +26,7 @@ vector<string> MetaStatsCommand::getValidParameters(){
 //**********************************************************************************************************************
 MetaStatsCommand::MetaStatsCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["metastats"] = tempOutNames;
        }
@@ -65,12 +64,12 @@ vector<string> MetaStatsCommand::getRequiredFiles(){
 MetaStatsCommand::MetaStatsCommand(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
@@ -206,7 +205,7 @@ MetaStatsCommand::~MetaStatsCommand(){}
 int MetaStatsCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                designMap = new GroupMap(designfile);
                designMap->readDesignMap();