]> git.donarmstrong.com Git - mothur.git/blobdiff - heatmapcommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / heatmapcommand.cpp
index 892010839f519495744e0d68518124ffa1778fae..19a320afa409e9e7be546b69c85f8c3c99e05fa6 100644 (file)
@@ -24,8 +24,7 @@ vector<string> HeatMapCommand::getValidParameters(){
 //**********************************************************************************************************************
 HeatMapCommand::HeatMapCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["svg"] = tempOutNames;
        }
@@ -62,12 +61,12 @@ vector<string> HeatMapCommand::getRequiredFiles(){
 HeatMapCommand::HeatMapCommand(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
@@ -183,7 +182,7 @@ HeatMapCommand::~HeatMapCommand(){
 int HeatMapCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                heatmap = new HeatMap(sorted, scale, numOTU, fontSize, outputDir);
                format = globaldata->getFormat();