]> git.donarmstrong.com Git - mothur.git/blobdiff - commandfactory.cpp
fixed misspelling on consensus
[mothur.git] / commandfactory.cpp
index 7dd35fd673a7bc62e109a0095efe847d5b097588..43f6769f92de125e9b76074e2a2d91cdb9ca3889 100644 (file)
@@ -12,7 +12,6 @@
 #include "readtreecommand.h"
 #include "readotucommand.h"
 #include "clustercommand.h"
-#include "parselistcommand.h"
 #include "collectcommand.h"
 #include "collectsharedcommand.h"
 #include "getgroupcommand.h"
@@ -39,7 +38,7 @@
 #include "getoturepcommand.h"
 #include "treegroupscommand.h"
 #include "bootstrapsharedcommand.h"
-#include "concensuscommand.h"
+//#include "consensuscommand.h"
 #include "distancecommand.h"
 #include "aligncommand.h"
 #include "matrixoutputcommand.h"
@@ -89,7 +88,7 @@ CommandFactory::CommandFactory(){
        commands["get.sabund"]          = "get.sabund";
        commands["get.rabund"]          = "get.rabund";
        commands["bootstrap.shared"]    = "bootstrap.shared";
-       commands["concensus"]                   = "concensus";
+       //commands["consensus"]                 = "consensus";
        commands["help"]                                = "help"; 
        commands["filter.seqs"]                 = "filter.seqs";
        commands["align.seqs"]                  = "align.seqs";
@@ -146,7 +145,7 @@ Command* CommandFactory::getCommand(string commandName, string optionString){
                else if(commandName == "tree.shared")                   {   command = new TreeGroupCommand(optionString);                       }
                else if(commandName == "dist.shared")                   {   command = new MatrixOutputCommand(optionString);            }
                else if(commandName == "bootstrap.shared")              {   command = new BootSharedCommand(optionString);                      }
-               else if(commandName == "concensus")                             {   command = new ConcensusCommand(optionString);                       }
+               //else if(commandName == "consensus")                           {   command = new ConcensusCommand(optionString);                       }
                else if(commandName == "dist.seqs")                             {   command = new DistanceCommand(optionString);                        }
                else if(commandName == "align.seqs")                    {   command = new AlignCommand(optionString);                           }
                else if(commandName == "summary.seqs")                  {       command = new SeqSummaryCommand(optionString);                  }
@@ -159,14 +158,9 @@ Command* CommandFactory::getCommand(string commandName, string optionString){
                return command;
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the CommandFactory class Function getCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "CommandFactory", "getCommand");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the CommandFactory class function getCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-
 }
 
 /***********************************************************************/
@@ -177,21 +171,17 @@ bool CommandFactory::isValidCommand(string command) {
                if ((commands.find(command)) != (commands.end())) {
                        return true;
                }else{
-                       cout << command << " is not a valid command in Mothur.  Valid commands are ";
+                       mothurOut(command + " is not a valid command in Mothur.  Valid commands are ");
                        for (it = commands.begin(); it != commands.end(); it++) {
-                               cout << it->first << ", ";
+                               mothurOut(it->first + ", ");
                        }
-                       cout << endl;
+                       mothurOutEndLine();
                        return false;
                }
                
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the CommandFactory class Function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the CommandFactory class function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "CommandFactory", "isValidCommand");
                exit(1);
        }
 }
@@ -206,11 +196,7 @@ void CommandFactory::printCommands(ostream& out) {
                out << endl;
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the CommandFactory class Function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the CommandFactory class function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "CommandFactory", "printCommands");
                exit(1);
        }
 }