X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mergefilecommand.cpp;h=0501859e258f82410fa8360ae86092a0b1ea86f6;hb=e8e13c129ba8184ec5932a090773f353f3ae3406;hp=cece52d9cd06b78950f5b197c19d2e9574b7daa8;hpb=1d898dc6edaf9e9f287fab53bf1f21fb29757a17;p=mothur.git diff --git a/mergefilecommand.cpp b/mergefilecommand.cpp index cece52d..0501859 100644 --- a/mergefilecommand.cpp +++ b/mergefilecommand.cpp @@ -41,7 +41,6 @@ string MergeFileCommand::getHelpString(){ exit(1); } } - //********************************************************************************************************************** MergeFileCommand::MergeFileCommand(){ try { @@ -64,7 +63,7 @@ MergeFileCommand::MergeFileCommand(string option) { if(option == "help") { help(); abort = true; calledHelp = true; - } + }else if(option == "citation") { citation(); abort = true; calledHelp = true;} else { vector myArray = setParameters(); @@ -130,29 +129,10 @@ int MergeFileCommand::execute(){ try { if (abort == true) { if (calledHelp) { return 0; } return 2; } - ofstream outputFile; - m->openOutputFile(outputFileName, outputFile); - - char c; - for(int i=0;iopenInputFile(fileNames[i], inputFile); - - while(!inputFile.eof()){ - if (m->control_pressed) { outputTypes.clear(); inputFile.close(); outputFile.close(); remove(outputFileName.c_str()); return 0; } - - c = inputFile.get(); - //-1 is eof char - if (int(c) != -1) { outputFile << c; } - } - - inputFile.close(); - } - - outputFile.close(); + m->mothurRemove(outputFileName); + for(int i=0;iappendFiles(fileNames[i], outputFileName); } - if (m->control_pressed) { outputTypes.clear(); remove(outputFileName.c_str()); return 0; } + if (m->control_pressed) { m->mothurRemove(outputFileName); return 0; } m->mothurOutEndLine(); m->mothurOut("Output File Name: "); m->mothurOutEndLine();