]> git.donarmstrong.com Git - mothur.git/blobdiff - optionparser.cpp
merged pat's trim seqs edits with sarah's major overhaul of global data; also added...
[mothur.git] / optionparser.cpp
index 7ff6ae7691b0437c1589051778d929307dbe36f1..2de1621bcb9a73ac9c17b02384ee6d9b0f3f5d49 100644 (file)
 #include "optionparser.h"
 
 /***********************************************************************/
-void OptionParser::parse(string option, map<string, string>& container) {
+
+OptionParser::OptionParser(string option) {
        try {
                
                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) {
@@ -37,4 +38,9 @@ void OptionParser::parse(string option, map<string, string>& container) {
                exit(1);
        }
 }
-/***********************************************************************/
\ No newline at end of file
+
+/***********************************************************************/
+
+map<string, string> OptionParser::getParameters() {    return parameters;      }
+
+/***********************************************************************/