]> git.donarmstrong.com Git - mothur.git/blobdiff - commandoptionparser.cpp
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / commandoptionparser.cpp
index e4db11d1993f3ee257b36b010fb22944abc3b1cd..e356afe5c74972e5298ddfa87a0672c97c4facfe 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 
-#include "globaldata.hpp"
 #include "commandoptionparser.hpp"
 
 
@@ -16,6 +15,8 @@
 //This Function parses through the command line and pulls out the command then sends the options to  the parseGlobalData
 CommandOptionParser::CommandOptionParser(string input){
        try {
+               m = MothurOut::getInstance();
+               
                int openParen = input.find_first_of('(');
                int closeParen = input.find_last_of(')');
                optionString = "";
@@ -25,21 +26,16 @@ CommandOptionParser::CommandOptionParser(string input){
                        commandString = input.substr(0, openParen);   //commandString contains everything before "("
                        optionString = input.substr((openParen+1), (closeParen-openParen-1)); //optionString contains everything between "(" and ")".
                }
-               else if (openParen == -1) { cout << "You are missing (" << endl; }
-               else if (closeParen == -1) { cout << "You are missing )" << endl; }
+               else if (openParen == -1) { m->mothurOut("[ERROR]: You are missing ("); m->mothurOutEndLine(); }
+               else if (closeParen == -1) { m->mothurOut("[ERROR]:You are missing )"); m->mothurOutEndLine(); }
                                        
                //GlobalData* globaldata = GlobalData::getInstance();
                //globaldata->parseGlobalData(commandString, optionString);                     //parser to separate and check options
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the CommandOptionParser class Function CommandOptionParser. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               m->errorOut(e, "CommandOptionParser", "CommandOptionParser");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the CommandOptionParser class function CommandOptionParser. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-
 }
 
 //**********************************************************************************************************************