]> git.donarmstrong.com Git - mothur.git/blobdiff - getgroupcommand.cpp
rewrote metastats command in c++, added mothurRemove function to handle ~ error....
[mothur.git] / getgroupcommand.cpp
index 6b76bf2d74a1c3443111dade5d7ceaad7a1c75a2..194e8e16b1e388bdb8d01ac372fbc884cbc92e43 100644 (file)
@@ -62,6 +62,7 @@ GetgroupCommand::GetgroupCommand(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<string> myArray = setParameters();
@@ -102,7 +103,7 @@ GetgroupCommand::GetgroupCommand(string option)  {
                                sharedfile = m->getSharedFile(); 
                                if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }
+                       }else { m->setSharedFile(sharedfile); }
                        
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
@@ -145,13 +146,13 @@ int GetgroupCommand::execute(){
                        in >> inputData;
                }
                
-               if (m->control_pressed) { outputTypes.clear(); in.close();  out.close(); remove(outputFile.c_str());   return 0; }
+               if (m->control_pressed) { outputTypes.clear(); in.close();  out.close(); m->mothurRemove(outputFile);   return 0; }
 
                if (in.eof() != true) { in >> nextLabel; }
                
                //read the rest of the groups info in
                while ((nextLabel == holdLabel) && (in.eof() != true)) {
-                       if (m->control_pressed) {  outputTypes.clear(); in.close();  out.close(); remove(outputFile.c_str());   return 0; }
+                       if (m->control_pressed) {  outputTypes.clear(); in.close();  out.close(); m->mothurRemove(outputFile);   return 0; }
                        
                        in >> groupN >> num;
                        count++;
@@ -171,7 +172,7 @@ int GetgroupCommand::execute(){
                in.close();
                out.close();
                
-               if (m->control_pressed) {  remove(outputFile.c_str());   return 0; }
+               if (m->control_pressed) {  m->mothurRemove(outputFile);   return 0; }
                
                m->mothurOutEndLine();
                m->mothurOut("Output File Name: "); m->mothurOutEndLine();