#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
int SetDirectoryCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
commandFactory = CommandFactory::getInstance();
#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);
#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);