X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=helpcommand.cpp;h=47d04f9d528ab14053f468f2eacc7e150db736c0;hp=fc2f291548e07ebc41e03bf121760d23f2c4a16d;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=c4fb347858dd8cfea4d2933f429fff4130dca65b diff --git a/helpcommand.cpp b/helpcommand.cpp index fc2f291..47d04f9 100644 --- a/helpcommand.cpp +++ b/helpcommand.cpp @@ -11,29 +11,22 @@ //********************************************************************************************************************** -HelpCommand::HelpCommand(string option){ - - - if (option != "") { mothurOut("There are no valid parameters for the help() command."); mothurOutEndLine(); } - - validCommands = new CommandFactory(); +HelpCommand::HelpCommand(string option) { + validCommands = CommandFactory::getInstance(); } - -//********************************************************************************************************************** - -HelpCommand::~HelpCommand(){} - //********************************************************************************************************************** - int HelpCommand::execute(){ - - validCommands->printCommands(cout); - mothurOut("For more information about a specific command type 'commandName(help)' i.e. 'read.dist(help)'"); mothurOutEndLine(); + try { + validCommands->printCommands(cout); + m->mothurOut("For more information about a specific command type 'commandName(help)' i.e. 'read.dist(help)'"); m->mothurOutEndLine(); - delete validCommands; + m->mothurOutEndLine(); m->mothurOut("For further assistance please refer to the Mothur manual on our wiki at http://www.mothur.org/wiki, or contact Pat Schloss at mothur.bugs@gmail.com.\n"); - mothurOutEndLine(); mothurOut("For further assistance please refer to the Mothur manual on our wiki at http://www.mothur.org/wiki, or contact Pat Schloss at mothur.bugs@gmail.com.\n"); - return 0; + return 0; + } + catch(exception& e) { + m->errorOut(e, "HelpCommand", "execute"); + exit(1); + } } - //**********************************************************************************************************************/