]> git.donarmstrong.com Git - mothur.git/blobdiff - setlogfilecommand.cpp
fixed get.lienage and remove.lineage bug with confidence scores that are floats....
[mothur.git] / setlogfilecommand.cpp
index 593664e3569d0ef8f9faeb31df9379ab2cafed41..f57dfafeacd9caae5711f56c17c3102e083567f0 100644 (file)
@@ -9,14 +9,49 @@
 
 #include "setlogfilecommand.h"
 
+//**********************************************************************************************************************
+vector<string> SetLogFileCommand::getValidParameters(){        
+       try {
+               string Array[] =  {"name","append","outputdir","inputdir"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SetLogFileCommand", "getValidParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SetLogFileCommand::getRequiredParameters(){     
+       try {
+               string Array[] =  {"name"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SetLogFileCommand", "getRequiredParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SetLogFileCommand::getRequiredFiles(){  
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SetLogFileCommand", "getRequiredFiles");
+               exit(1);
+       }
+}
 //**********************************************************************************************************************
 
 SetLogFileCommand::SetLogFileCommand(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
@@ -36,7 +71,7 @@ SetLogFileCommand::SetLogFileCommand(string option)  {
                        if (name == "not found") {  m->mothurOut("name is a required parameter for the set.logfile command."); abort = true; } 
                        
                        string temp = validParameter.validFile(parameters, "append", false);            if (temp == "not found") {  temp = "F";  }
-                       append = isTrue(temp);
+                       append = m->isTrue(temp);
                }
        }
        catch(exception& e) {
@@ -68,7 +103,7 @@ SetLogFileCommand::~SetLogFileCommand(){}
 int SetLogFileCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                commandFactory = CommandFactory::getInstance();