]> git.donarmstrong.com Git - mothur.git/blobdiff - bootstrapsharedcommand.cpp
random chagnes from pat
[mothur.git] / bootstrapsharedcommand.cpp
index b7d6c45e6e0179704a0e902c7960810e65df7eca..afc3cf1533475b6bf78b8127ba34086193612371 100644 (file)
@@ -34,8 +34,7 @@ vector<string> BootSharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 BootSharedCommand::BootSharedCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["tree"] = tempOutNames;
        }
@@ -71,14 +70,14 @@ vector<string> BootSharedCommand::getRequiredFiles(){
 BootSharedCommand::BootSharedCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Groups.clear();
                Estimators.clear();
                
                //allow user to run help
-               if(option == "help") { help(); abort = true; }
+               if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -235,7 +234,7 @@ BootSharedCommand::~BootSharedCommand(){
 int BootSharedCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                util = new SharedUtil();        
        
@@ -341,6 +340,13 @@ int BootSharedCommand::execute(){
                //reset groups parameter
                globaldata->Groups.clear();  
                
+               //set first tree file as new current treefile
+               string currentTree = "";
+               itTypes = outputTypes.find("tree");
+               if (itTypes != outputTypes.end()) {
+                       if ((itTypes->second).size() != 0) { currentTree = (itTypes->second)[0]; m->setTreeFile(currentTree); }
+               }
+               
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }