]> git.donarmstrong.com Git - mothur.git/blobdiff - setdircommand.cpp
mods to seq.errror
[mothur.git] / setdircommand.cpp
index 043c0acc8ec524c1b510da28c36c149d300f215a..a76db24282e2c00032ec747de2d1d5decf20e095 100644 (file)
@@ -9,14 +9,48 @@
 
 #include "setdircommand.h"
 
+//**********************************************************************************************************************
+vector<string> SetDirectoryCommand::getValidParameters(){      
+       try {
+               string Array[] =  {"output","input","tempdefault","outputdir","inputdir"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SetDirectoryCommand", "getValidParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SetDirectoryCommand::getRequiredParameters(){   
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SetDirectoryCommand", "getRequiredParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SetDirectoryCommand::getRequiredFiles(){        
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SetDirectoryCommand", "getRequiredFiles");
+               exit(1);
+       }
+}
 //**********************************************************************************************************************
 
 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
@@ -83,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();
                
@@ -106,7 +140,7 @@ int SetDirectoryCommand::execute(){
                        #endif
                        
                        //test to make sure directory exists
-                       output = getFullPathName(output);
+                       output = m->getFullPathName(output);
                        string outTemp = output + "temp";
                        ofstream out;
                        out.open(outTemp.c_str(), ios::trunc);
@@ -139,7 +173,7 @@ int SetDirectoryCommand::execute(){
                        #endif
                        
                        //test to make sure directory exists
-                       input = getFullPathName(input);
+                       input = m->getFullPathName(input);
                        string inTemp = input + "temp";
                        ofstream in;
                        in.open(inTemp.c_str(), ios::trunc);