else {
//valid paramters for this command
- string Array[] = {"label","sorted"};
+ string Array[] = {"label","sorted","outputdir","inputdir"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
}
+ //if the user changes the output directory command factory will send this info to us in the output parameter
+ string outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){
+ outputDir = "";
+ outputDir += hasPath(globaldata->inputFileName); //if user entered a file with a path then preserve it
+ }
+
//make sure the user has already run the read.otu command
if (globaldata->getListFile() == "") { mothurOut("You must read a listfile before you can use the get.rabund command."); mothurOutEndLine(); abort = true; }
}
if (abort == false) {
- filename = getRootName(globaldata->inputFileName) + "rabund";
+ filename = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + "rabund";
openOutputFile(filename, out);
}
}