]> git.donarmstrong.com Git - mothur.git/blobdiff - validcommands.cpp
deleted read.shared command and added its functionality to read.otu.
[mothur.git] / validcommands.cpp
index 53ee7431b49fecc06002e5b9330259371bd35729..1ccb8fca51577674af1ecb2fa5fe895655330654 100644 (file)
@@ -24,6 +24,9 @@ ValidCommands::ValidCommands() {
                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"; 
@@ -55,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(), read.tree(), cluster(), deconvolute(), collect.single(), collect.shared(), rarefaction.single(), rarefaction.shared(), summary.single(), summary.shared(), parsimony(), unifrac.weighted(), unifrac.unweighted(), 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;
                }
                
@@ -71,3 +78,24 @@ bool ValidCommands::isValidCommand(string command) {
 }
 
 /***********************************************************************/
+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);
+       }
+}
+
+
+
+