X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=setdircommand.cpp;h=42e49a1be039ce16f6ea412ca8b9de15fea106f1;hp=3e50f4a508d2608ef1b51b9445fd3a388d1f4dec;hb=ad4f75fd7c938090d3b1ce4cfefcc21edf1869eb;hpb=d39c47623faf0dc1e271f3d50efa6b029b622b88 diff --git a/setdircommand.cpp b/setdircommand.cpp index 3e50f4a..42e49a1 100644 --- a/setdircommand.cpp +++ b/setdircommand.cpp @@ -121,67 +121,67 @@ int SetDirectoryCommand::execute(){ if (abort == true) { if (calledHelp) { return 0; } return 2; } - if (debugOnly) { return 0; } - - commandFactory = CommandFactory::getInstance(); - - m->mothurOut("Mothur's directories:"); m->mothurOutEndLine(); - - //redirect output - if ((output == "clear") || (output == "")) { output = ""; commandFactory->setOutputDirectory(output); } - else if (output == "default") { - string exepath = m->argv; - output = exepath.substr(0, (exepath.find_last_of('m'))); - - m->mothurOut("outputDir=" + output); m->mothurOutEndLine(); - commandFactory->setOutputDirectory(output); - }else { - if (m->dirCheck(output)) { - m->mothurOut("outputDir=" + output); m->mothurOutEndLine(); - commandFactory->setOutputDirectory(output); + if (debugOnly) { } + else { + commandFactory = CommandFactory::getInstance(); + + m->mothurOut("Mothur's directories:"); m->mothurOutEndLine(); + + //redirect output + if ((output == "clear") || (output == "")) { output = ""; commandFactory->setOutputDirectory(output); } + else if (output == "default") { + string exepath = m->argv; + output = exepath.substr(0, (exepath.find_last_of('m'))); + + m->mothurOut("outputDir=" + output); m->mothurOutEndLine(); + commandFactory->setOutputDirectory(output); + }else { + if (m->dirCheck(output)) { + m->mothurOut("outputDir=" + output); m->mothurOutEndLine(); + commandFactory->setOutputDirectory(output); + } } - } - - //redirect input - if ((input == "clear") || (input == "")) { input = ""; commandFactory->setInputDirectory(input); } - else if (input == "default") { - string exepath = m->argv; - input = exepath.substr(0, (exepath.find_last_of('m'))); - - m->mothurOut("inputDir=" + input); m->mothurOutEndLine(); - commandFactory->setInputDirectory(input); - }else { - if (m->dirCheck(input)) { - m->mothurOut("inputDir=" + input); m->mothurOutEndLine(); - commandFactory->setInputDirectory(input); + + //redirect input + if ((input == "clear") || (input == "")) { input = ""; commandFactory->setInputDirectory(input); } + else if (input == "default") { + string exepath = m->argv; + input = exepath.substr(0, (exepath.find_last_of('m'))); + + m->mothurOut("inputDir=" + input); m->mothurOutEndLine(); + commandFactory->setInputDirectory(input); + }else { + if (m->dirCheck(input)) { + m->mothurOut("inputDir=" + input); m->mothurOutEndLine(); + commandFactory->setInputDirectory(input); + } } - } - - //set default - if (tempdefault == "clear") { - #ifdef MOTHUR_FILES - string temp = MOTHUR_FILES; - m->mothurOut("tempDefault=" + temp); m->mothurOutEndLine(); + + //set default + if (tempdefault == "clear") { +#ifdef MOTHUR_FILES + string temp = MOTHUR_FILES; + m->mothurOut("tempDefault=" + temp); m->mothurOutEndLine(); m->setDefaultPath(temp); - #else - string temp = ""; - m->mothurOut("No default directory defined at compile time."); m->mothurOutEndLine(); +#else + string temp = ""; + m->mothurOut("No default directory defined at compile time."); m->mothurOutEndLine(); m->setDefaultPath(temp); - #endif - }else if (tempdefault == "") { //do nothing - }else if (tempdefault == "default") { - string exepath = m->argv; - tempdefault = exepath.substr(0, (exepath.find_last_of('m'))); - - m->mothurOut("tempDefault=" + tempdefault); m->mothurOutEndLine(); - m->setDefaultPath(tempdefault); - }else { - if (m->dirCheck(tempdefault)) { +#endif + }else if (tempdefault == "") { //do nothing + }else if (tempdefault == "default") { + string exepath = m->argv; + tempdefault = exepath.substr(0, (exepath.find_last_of('m'))); + m->mothurOut("tempDefault=" + tempdefault); m->mothurOutEndLine(); - m->setDefaultPath(tempdefault); + m->setDefaultPath(tempdefault); + }else { + if (m->dirCheck(tempdefault)) { + m->mothurOut("tempDefault=" + tempdefault); m->mothurOutEndLine(); + m->setDefaultPath(tempdefault); + } } } - return 0; } catch(exception& e) {