X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=validcommands.cpp;h=1ccb8fca51577674af1ecb2fa5fe895655330654;hb=39ef0543b73cb12dfc64529522b66ad3df7527d0;hp=bd9d80eb9efb960fcb8bec4218a30be7e198b04a;hpb=fd282e6b4be2560f5b1bd154a9e8d24b798eefaf;p=mothur.git diff --git a/validcommands.cpp b/validcommands.cpp index bd9d80e..1ccb8fc 100644 --- a/validcommands.cpp +++ b/validcommands.cpp @@ -15,17 +15,25 @@ ValidCommands::ValidCommands() { try { commands["read.dist"] = "read.dist"; - commands["read.otu"] = "read.otu"; + commands["read.otu"] = "read.otu"; + commands["read.tree"] = "read.tree"; commands["cluster"] = "cluster"; commands["deconvolute"] = "deconvolute"; + commands["parsimony"] = "parsimony"; commands["help"] = "help"; commands["quit"] = "quit"; commands["collect.single"] = "collect.single"; commands["collect.shared"] = "collect.shared"; + commands["get.group"] = "get.group"; + commands["get.label"] = "get.label"; + commands["get.line"] = "get.line"; commands["rarefaction.single"] = "rarefaction.single"; commands["rarefaction.shared"] = "rarefaction.shared"; commands["summary.single"] = "summary.single"; commands["summary.shared"] = "summary.shared"; + commands["unifrac.weighted"] = "unifrac.weighted"; + commands["unifrac.unweighted"] = "unifrac.unweighted"; + } catch(exception& e) { @@ -50,7 +58,11 @@ bool ValidCommands::isValidCommand(string command) { if ((commands.find(command)) != (commands.end())) { return true; }else{ - cout << command << " is not a valid command in Mothur. Valid commands are read.dist(), read.otu(), cluster(), collect.single(), collect.shared(), rarefaction.single(), rarefaction.shared(), summary.single(), summary.shared(), quit(), help()." << endl; + cout << command << " is not a valid command in Mothur. Valid commands are "; + for (it = commands.begin(); it != commands.end(); it++) { + cout << it->first << ", "; + } + cout << endl; return false; } @@ -65,4 +77,25 @@ bool ValidCommands::isValidCommand(string command) { } } -/***********************************************************************/ \ No newline at end of file +/***********************************************************************/ +void ValidCommands::printCommands(ostream& out) { + try { + out << "Valid commands are "; + for (it = commands.begin(); it != commands.end(); it++) { + out << it->first << ", "; + } + out << endl; + } + catch(exception& e) { + cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } + catch(...) { + cout << "An unknown error has occurred in the ValidCommands class function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } +} + + + +