]> git.donarmstrong.com Git - mothur.git/blobdiff - getgroupcommand.cpp
added logfile feature
[mothur.git] / getgroupcommand.cpp
index 4fa84136001aefaeb051ee592a41e54b081b0885..95baec8e72a5ea9202261790279fc5080e0ca3ad 100644 (file)
@@ -19,9 +19,9 @@ GetgroupCommand::GetgroupCommand(string option){
                if(option == "help") { help(); abort = true; }
                
                else {
-                       if (option != "") { cout << "There are no valid parameters for the get.group command." << endl; abort = true; }
+                       if (option != "") { mothurOut("There are no valid parameters for the get.group command."); mothurOutEndLine(); abort = true; }
                        
-                       if ((globaldata->getSharedFile() == "")) { cout << "You must use the read.otu command to read a groupfile or a sharedfile before you can use the get.group command." << endl; abort = true; }
+                       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 (abort == false) {
                                //open shared file
@@ -36,35 +36,26 @@ GetgroupCommand::GetgroupCommand(string option){
                }
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "GetgroupCommand", "GetgroupCommand");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the GetgroupCommand class function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }       
-                       
 }
 //**********************************************************************************************************************
 
 void GetgroupCommand::help(){
        try {
-               cout << "The get.group command can only be executed after a successful read.otu command." << "\n";
-               //cout << "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 concensus command." << "\n";
-               cout << "You may not use any parameters with the get.group command." << "\n";
-               cout << "The get.group command should be in the following format: " << "\n";
-               cout << "get.group()" << "\n";
-               cout << "Example get.group()." << "\n";
+               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 concensus 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");
                
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function help. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "GetgroupCommand", "help");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the GetgroupCommand class function help. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }       
 }
 
 //**********************************************************************************************************************
@@ -88,7 +79,7 @@ int GetgroupCommand::execute(){
                holdLabel = label;
                
                //output first group
-               cout << groupN << endl;
+               mothurOut(groupN); mothurOutEndLine();
                out << groupN << '\t' << groupN << endl;        
                        
                //get rest of line
@@ -104,7 +95,7 @@ int GetgroupCommand::execute(){
                        count++;
                        
                        //output next group
-                       cout << groupN << endl;
+                       mothurOut(groupN); mothurOutEndLine();
                        out << groupN << '\t' << groupN << endl;                                
                        
                        //fill vector.  
@@ -121,13 +112,9 @@ int GetgroupCommand::execute(){
        }
 
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "GetgroupCommand", "execute");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the GetgroupCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }       
 }