]> git.donarmstrong.com Git - mothur.git/blobdiff - setlogfilecommand.cpp
removed read.dist, read.otu, read.tree and globaldata. added current to defaults...
[mothur.git] / setlogfilecommand.cpp
index f57dfafeacd9caae5711f56c17c3102e083567f0..00e702c7b86d3d7bd16dfa5a162250f49402dae1 100644 (file)
@@ -9,38 +9,37 @@
 
 #include "setlogfilecommand.h"
 
+
 //**********************************************************************************************************************
-vector<string> SetLogFileCommand::getValidParameters(){        
+vector<string> SetLogFileCommand::setParameters(){     
        try {
-               string Array[] =  {"name","append","outputdir","inputdir"};
-               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               CommandParameter pappend("append", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(pappend);
+               CommandParameter pname("name", "String", "", "", "", "", "",false,true); parameters.push_back(pname);
+               CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
+               CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
+               
+               vector<string> myArray;
+               for (int i = 0; i < parameters.size(); i++) {   myArray.push_back(parameters[i].name);          }
                return myArray;
        }
        catch(exception& e) {
-               m->errorOut(e, "SetLogFileCommand", "getValidParameters");
+               m->errorOut(e, "SetLogFileCommand", "setParameters");
                exit(1);
        }
 }
 //**********************************************************************************************************************
-vector<string> SetLogFileCommand::getRequiredParameters(){     
+string SetLogFileCommand::getHelpString(){     
        try {
-               string Array[] =  {"name"};
-               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
-               return myArray;
+               string helpString = "";
+               helpString += "The set.logfile command can be used to provide a specific name for your logfile and/or to append the log generated by mothur to an existing file.\n";
+               helpString += "The set.logfile command parameters are name and append, name is required. Append is set to false by default.\n";
+               helpString += "The set.logfile command should be in the following format: set.logfile(name=yourLogFileName, append=T).\n";
+               helpString += "Example set.logfile(name=/Users/lab/desktop/output.txt, append=T).\n";
+               helpString += "Note: No spaces between parameter labels (i.e. name), '=' and parameters (i.e.yourLogFileName).\n\n";
+               return helpString;
        }
        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");
+               m->errorOut(e, "SetLogFileCommand", "getHelpString");
                exit(1);
        }
 }
@@ -79,24 +78,6 @@ SetLogFileCommand::SetLogFileCommand(string option)  {
                exit(1);
        }
 }
-//**********************************************************************************************************************
-
-void SetLogFileCommand::help(){
-       try {
-               m->mothurOut("The set.logfile command can be used to provide a specific name for your logfile and/or to append the log generated by mothur to an existing file.\n");
-               m->mothurOut("The set.logfile command parameters are name and append, name is required. Append is set to false by default.\n");
-               m->mothurOut("The set.logfile command should be in the following format: set.logfile(name=yourLogFileName, append=T).\n");
-               m->mothurOut("Example set.logfile(name=/Users/lab/desktop/output.txt, append=T).\n");
-               m->mothurOut("Note: No spaces between parameter labels (i.e. name), '=' and parameters (i.e.yourLogFileName).\n\n");
-       }
-       catch(exception& e) {
-               m->errorOut(e, "SetLogFileCommand", "help");
-               exit(1);
-       }
-}
-//**********************************************************************************************************************
-
-SetLogFileCommand::~SetLogFileCommand(){}
 
 //**********************************************************************************************************************