]> git.donarmstrong.com Git - mothur.git/blobdiff - setlogfilecommand.cpp
mods to trim.seqs
[mothur.git] / setlogfilecommand.cpp
index 19f3ed129ab85b9f66dbea06c56637ea2f8daa42..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
@@ -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();