]> git.donarmstrong.com Git - mothur.git/blobdiff - getgroupcommand.cpp
created mothurOut class to handle logfiles
[mothur.git] / getgroupcommand.cpp
index c754f8eb1bb2ba79daf77c3a060a0ebf770252dd..b645517f938928c44eb5faa5871e4171c40fb800 100644 (file)
@@ -10,7 +10,7 @@
 #include "getgroupcommand.h"
 
 //**********************************************************************************************************************
-GetgroupCommand::GetgroupCommand(string option){
+GetgroupCommand::GetgroupCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
                abort = false;
@@ -35,7 +35,7 @@ GetgroupCommand::GetgroupCommand(string option){
                        //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 = "";         }
                        
-                       if ((globaldata->getSharedFile() == "")) { mothurOut("You must use the read.otu command to read a groupfile or a sharedfile before you can use the get.group command."); mothurOutEndLine(); abort = true; }
+                       if ((globaldata->getSharedFile() == "")) { m->mothurOut("You must use the read.otu command to read a groupfile or a sharedfile before you can use the get.group command."); m->mothurOutEndLine(); abort = true; }
                                
                        if (abort == false) {
                                //open shared file
@@ -51,7 +51,7 @@ GetgroupCommand::GetgroupCommand(string option){
                }
        }
        catch(exception& e) {
-               errorOut(e, "GetgroupCommand", "GetgroupCommand");
+               m->errorOut(e, "GetgroupCommand", "GetgroupCommand");
                exit(1);
        }
 }
@@ -59,16 +59,16 @@ GetgroupCommand::GetgroupCommand(string option){
 
 void GetgroupCommand::help(){
        try {
-               mothurOut("The get.group command can only be executed after a successful read.otu command.\n");
-               //mothurOut("The get.group command outputs a .bootGroups file to you can use in addition to the tree file generated by the bootstrap.shared command to run the consensus command.\n");
-               mothurOut("You may not use any parameters with the get.group command.\n");
-               mothurOut("The get.group command should be in the following format: \n");
-               mothurOut("get.group()\n");
-               mothurOut("Example get.group().\n");
+               m->mothurOut("The get.group command can only be executed after a successful read.otu command.\n");
+               //m->mothurOut("The get.group command outputs a .bootGroups file to you can use in addition to the tree file generated by the bootstrap.shared command to run the consensus command.\n");
+               m->mothurOut("You may not use any parameters with the get.group command.\n");
+               m->mothurOut("The get.group command should be in the following format: \n");
+               m->mothurOut("get.group()\n");
+               m->mothurOut("Example get.group().\n");
                
        }
        catch(exception& e) {
-               errorOut(e, "GetgroupCommand", "help");
+               m->errorOut(e, "GetgroupCommand", "help");
                exit(1);
        }
 }
@@ -94,7 +94,7 @@ int GetgroupCommand::execute(){
                holdLabel = label;
                
                //output first group
-               mothurOut(groupN); mothurOutEndLine();
+               m->mothurOut(groupN); m->mothurOutEndLine();
                out << groupN << '\t' << groupN << endl;        
                        
                //get rest of line
@@ -110,7 +110,7 @@ int GetgroupCommand::execute(){
                        count++;
                        
                        //output next group
-                       mothurOut(groupN); mothurOutEndLine();
+                       m->mothurOut(groupN); m->mothurOutEndLine();
                        out << groupN << '\t' << groupN << endl;                                
                        
                        //fill vector.  
@@ -123,11 +123,17 @@ int GetgroupCommand::execute(){
                
                in.close();
                out.close();
+               
+               m->mothurOutEndLine();
+               m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+               m->mothurOut(outputFile); m->mothurOutEndLine();        
+               m->mothurOutEndLine();
+               
                return 0;       
        }
 
        catch(exception& e) {
-               errorOut(e, "GetgroupCommand", "execute");
+               m->errorOut(e, "GetgroupCommand", "execute");
                exit(1);
        }
 }