]> git.donarmstrong.com Git - mothur.git/blobdiff - pcoacommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / pcoacommand.cpp
index fbcb7e08779d14f28277d8b5e8d0a8ce3b088174..d8efb2551e2bb6b2f459f14ad041c188f31926da 100644 (file)
@@ -26,8 +26,7 @@ vector<string> PCOACommand::getValidParameters(){
 //**********************************************************************************************************************
 PCOACommand::PCOACommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["pcoa"] = tempOutNames;
                outputTypes["loadings"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> PCOACommand::getRequiredFiles(){
 
 PCOACommand::PCOACommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                
                //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
@@ -149,7 +148,7 @@ PCOACommand::~PCOACommand(){}
 int PCOACommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                cout.setf(ios::fixed, ios::floatfield);
                cout.setf(ios::showpoint);