]> git.donarmstrong.com Git - mothur.git/blobdiff - setdircommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / setdircommand.cpp
index 214bd172e80208f246bede7978ad69329f6e23db..a76db24282e2c00032ec747de2d1d5decf20e095 100644 (file)
@@ -47,10 +47,10 @@ vector<string> SetDirectoryCommand::getRequiredFiles(){
 
 SetDirectoryCommand::SetDirectoryCommand(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
@@ -117,7 +117,7 @@ SetDirectoryCommand::~SetDirectoryCommand(){}
 int SetDirectoryCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                commandFactory = CommandFactory::getInstance();