X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=commandfactory.cpp;h=ce51d7228b415228da4c6c15121001989d03b75a;hb=14cddf859d97118481161bf3e85a647976020758;hp=6d87a68c49c6d9154572adcbc51ebc3b4555a35f;hpb=035f86272c776e1cccaa47021e26782e49cd41e7;p=mothur.git diff --git a/commandfactory.cpp b/commandfactory.cpp index 6d87a68..ce51d72 100644 --- a/commandfactory.cpp +++ b/commandfactory.cpp @@ -136,6 +136,8 @@ #include "loadlogfilecommand.h" #include "sffmultiplecommand.h" #include "classifysharedcommand.h" +#include "filtersharedcommand.h" +#include "primerdesigncommand.h" /*******************************************************/ @@ -295,6 +297,8 @@ CommandFactory::CommandFactory(){ commands["sff.multiple"] = "sff.multiple"; commands["quit"] = "MPIEnabled"; commands["classify.shared"] = "classify.shared"; + commands["filter.shared"] = "filter.shared"; + commands["primer.design"] = "primer.design"; } @@ -510,6 +514,8 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ else if(commandName == "load.logfile") { command = new LoadLogfileCommand(optionString); } else if(commandName == "sff.multiple") { command = new SffMultipleCommand(optionString); } else if(commandName == "classify.shared") { command = new ClassifySharedCommand(optionString); } + else if(commandName == "filter.shared") { command = new FilterSharedCommand(optionString); } + else if(commandName == "primer.design") { command = new PrimerDesignCommand(optionString); } else { command = new NoCommand(optionString); } return command; @@ -666,6 +672,8 @@ Command* CommandFactory::getCommand(string commandName, string optionString, str else if(commandName == "load.logfile") { pipecommand = new LoadLogfileCommand(optionString); } else if(commandName == "sff.multiple") { pipecommand = new SffMultipleCommand(optionString); } else if(commandName == "classify.shared") { pipecommand = new ClassifySharedCommand(optionString); } + else if(commandName == "filter.shared") { pipecommand = new FilterSharedCommand(optionString); } + else if(commandName == "primer.design") { pipecommand = new PrimerDesignCommand(optionString); } else { pipecommand = new NoCommand(optionString); } return pipecommand; @@ -808,6 +816,8 @@ Command* CommandFactory::getCommand(string commandName){ else if(commandName == "load.logfile") { shellcommand = new LoadLogfileCommand(); } else if(commandName == "sff.multiple") { shellcommand = new SffMultipleCommand(); } else if(commandName == "classify.shared") { shellcommand = new ClassifySharedCommand(); } + else if(commandName == "filter.shared") { shellcommand = new FilterSharedCommand(); } + else if(commandName == "primer.design") { shellcommand = new PrimerDesignCommand(); } else { shellcommand = new NoCommand(); } return shellcommand; @@ -887,6 +897,41 @@ void CommandFactory::printCommands(ostream& out) { } } /***********************************************************************/ +void CommandFactory::printCommandsCategories(ostream& out) { + try { + map commands = getListCommands(); + map::iterator it; + + map categories; + map::iterator itCat; + //loop through each command outputting info + for (it = commands.begin(); it != commands.end(); it++) { + + Command* thisCommand = getCommand(it->first); + + //don't add hidden commands + if (thisCommand->getCommandCategory() != "Hidden") { + itCat = categories.find(thisCommand->getCommandCategory()); + if (itCat == categories.end()) { + categories[thisCommand->getCommandCategory()] = thisCommand->getCommandName(); + }else { + categories[thisCommand->getCommandCategory()] += ", " + thisCommand->getCommandName(); + } + } + } + + for (itCat = categories.begin(); itCat != categories.end(); itCat++) { + out << itCat->first << " commmands include: " << itCat->second << endl; + } + + } + catch(exception& e) { + m->errorOut(e, "CommandFactory", "printCommandsCategories"); + exit(1); + } +} + +/***********************************************************************/