]> git.donarmstrong.com Git - mothur.git/blobdiff - optionparser.cpp
added MPI code, broke up chimera.seqs into 5 separated commands, added parse.sff...
[mothur.git] / optionparser.cpp
index 7ff6ae7691b0437c1589051778d929307dbe36f1..c50d5a3107bb8c88f7dc251831873cfdd0d68e2b 100644 (file)
 #include "optionparser.h"
 
 /***********************************************************************/
-void OptionParser::parse(string option, map<string, string>& container) {
+
+OptionParser::OptionParser(string option) {
        try {
-               
+               m = MothurOut::getInstance();
                if (option != "") {
-               
+                       
                        string key, value;              
                        //reads in parameters and values
                        while((option.find_first_of(',') != -1)) {  //while there are parameters
-                                       splitAtComma(value, option);
-                                       splitAtEquals(key, value);
-                                       container[key] = value;
+                               splitAtComma(value, option);
+                               splitAtEquals(key, value);
+                               parameters[key] = value;
                        }
-               
+                       
                        //in case there is no comma and to get last parameter after comma
                        splitAtEquals(key, option);
-                       container[key] = option;
+                       parameters[key] = option;
                }
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the OptionParser class Function parse. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the OptionParser class function parse. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               m->errorOut(e, "OptionParser", "parse");
                exit(1);
        }
 }
-/***********************************************************************/
\ No newline at end of file
+
+/***********************************************************************/
+
+map<string, string> OptionParser::getParameters() {    return parameters;      }
+
+/***********************************************************************/