X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getsabundcommand.cpp;h=4ae2eaa004f9df9cc75c12b63626ffa7fad71ea7;hb=94d43af803e4be78b2ba8049669504e854ad13be;hp=ebfa839161fc3d59cd27f9a2f8e2e24743b85e7e;hpb=1d898dc6edaf9e9f287fab53bf1f21fb29757a17;p=mothur.git diff --git a/getsabundcommand.cpp b/getsabundcommand.cpp index ebfa839..4ae2eaa 100644 --- a/getsabundcommand.cpp +++ b/getsabundcommand.cpp @@ -67,6 +67,7 @@ GetSAbundCommand::GetSAbundCommand(string option) { //allow user to run help if(option == "help") { help(); abort = true; calledHelp = true; } + else if(option == "citation") { citation(); abort = true; calledHelp = true;} else { vector myArray = setParameters(); @@ -113,12 +114,12 @@ GetSAbundCommand::GetSAbundCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { listfile = ""; abort = true; } else if (listfile == "not found") { listfile = ""; } - else { format = "list"; inputfile = listfile; } + else { format = "list"; inputfile = listfile; m->setListFile(listfile); } rabundfile = validParameter.validFile(parameters, "rabund", true); if (rabundfile == "not open") { rabundfile = ""; abort = true; } else if (rabundfile == "not found") { rabundfile = ""; } - else { format = "rabund"; inputfile = rabundfile; } + else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(rabundfile); } //check for optional parameter and set defaults @@ -177,7 +178,7 @@ int GetSAbundCommand::execute(){ set processedLabels; set userLabels = labels; - if (m->control_pressed) { outputTypes.clear(); out.close(); remove(filename.c_str()); delete sabund; delete input; return 0; } + if (m->control_pressed) { outputTypes.clear(); out.close(); m->mothurRemove(filename); delete sabund; delete input; return 0; } while((sabund != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { @@ -186,9 +187,8 @@ int GetSAbundCommand::execute(){ m->mothurOut(sabund->getLabel()); m->mothurOutEndLine(); sabund->print(out); - delete sabund; - if (m->control_pressed) { outputTypes.clear(); out.close(); remove(filename.c_str()); delete sabund; delete input; return 0; } + if (m->control_pressed) { outputTypes.clear(); out.close(); m->mothurRemove(filename); delete sabund; delete input; return 0; } processedLabels.insert(sabund->getLabel()); userLabels.erase(sabund->getLabel()); @@ -202,9 +202,8 @@ int GetSAbundCommand::execute(){ m->mothurOut(sabund->getLabel()); m->mothurOutEndLine(); sabund->print(out); - delete sabund; - if (m->control_pressed) { outputTypes.clear(); out.close(); remove(filename.c_str()); delete sabund; delete input; return 0; } + if (m->control_pressed) { outputTypes.clear(); out.close(); m->mothurRemove(filename); delete sabund; delete input; return 0; } processedLabels.insert(sabund->getLabel()); userLabels.erase(sabund->getLabel()); @@ -242,7 +241,7 @@ int GetSAbundCommand::execute(){ sabund->print(out); delete sabund; - if (m->control_pressed) { outputTypes.clear(); out.close(); remove(filename.c_str()); delete input; return 0; } + if (m->control_pressed) { outputTypes.clear(); out.close(); m->mothurRemove(filename); delete input; return 0; } }