X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=listseqscommand.cpp;h=bfbb0788c5092382f22bea643c5405674361dd67;hb=957d67f7d8bbadfd2930de061e89fd9b149270fd;hp=afbacc00aaaec2b92c5d81278d16b463c0f43ffe;hpb=88fbc534a92cb91900e98a3288dfa1f68828b69b;p=mothur.git diff --git a/listseqscommand.cpp b/listseqscommand.cpp index afbacc0..bfbb078 100644 --- a/listseqscommand.cpp +++ b/listseqscommand.cpp @@ -49,7 +49,26 @@ string ListSeqsCommand::getHelpString(){ exit(1); } } - +//********************************************************************************************************************** +string ListSeqsCommand::getOutputFileNameTag(string type, string inputName=""){ + try { + string outputFileName = ""; + map >::iterator it; + + //is this a type this command creates + it = outputTypes.find(type); + if (it == outputTypes.end()) { m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); } + else { + if (type == "accnos") { outputFileName = "accnos"; } + else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true; } + } + return outputFileName; + } + catch(exception& e) { + m->errorOut(e, "ListSeqsCommand", "getOutputFileNameTag"); + exit(1); + } +} //********************************************************************************************************************** ListSeqsCommand::ListSeqsCommand(){ try { @@ -214,7 +233,7 @@ int ListSeqsCommand::execute(){ if (outputDir == "") { outputDir += m->hasPath(inputFileName); } - string outputFileName = outputDir + m->getRootName(m->getSimpleName(inputFileName)) + "accnos"; + string outputFileName = outputDir + m->getRootName(m->getSimpleName(inputFileName)) + getOutputFileNameTag("accnos"); ofstream out; m->openOutputFile(outputFileName, out);