X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=mergefilecommand.cpp;h=d5973394e5a097e879bf1526689d137266a417c1;hp=fcf63895b960fa8293df03dcff7c1e5bce28c914;hb=315e38cf393c82be238da5b32574f225a020d25c;hpb=c99f3846e7a7b6f06ab46508baa5409204ad6290 diff --git a/mergefilecommand.cpp b/mergefilecommand.cpp index fcf6389..d597339 100644 --- a/mergefilecommand.cpp +++ b/mergefilecommand.cpp @@ -21,7 +21,7 @@ MergeFileCommand::MergeFileCommand(string option){ } else { //valid paramters for this command - string Array[] = {"input", "output"}; + string Array[] = {"input", "output","outputdir","inputdir"}; vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); OptionParser parser(option); @@ -34,10 +34,18 @@ MergeFileCommand::MergeFileCommand(string option){ if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; } } + //if the user changes the input directory command factory will send this info to us in the output parameter + string inputDir = validParameter.validFile(parameters, "inputdir", false); + if (inputDir == "not found"){ inputDir = ""; } + string fileList = validParameter.validFile(parameters, "input", false); if(fileList == "not found") { mothurOut("you must enter two or more file names"); mothurOutEndLine(); abort=true; } else{ splitAtDash(fileList, fileNames); } + //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 = ""; } + + numInputFiles = fileNames.size(); ifstream testFile; if(numInputFiles == 0){ @@ -46,6 +54,12 @@ MergeFileCommand::MergeFileCommand(string option){ } else{ for(int i=0;i