]> git.donarmstrong.com Git - mothur.git/blobdiff - getgroupscommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / getgroupscommand.cpp
index 1832f96aed8122020b5ddf0ad5881275e3cc6481..635f68fc51a4151d7714d2934484cf4c44c1e16c 100644 (file)
@@ -27,8 +27,7 @@ vector<string> GetGroupsCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetGroupsCommand::GetGroupsCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
@@ -67,10 +66,10 @@ vector<string> GetGroupsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 GetGroupsCommand::GetGroupsCommand(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
@@ -222,7 +221,7 @@ void GetGroupsCommand::help(){
 int GetGroupsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                groupMap = new GroupMap(groupfile);
                groupMap->readMap();