- //check to make sure all parameters are valid for command
- for (map<string,string>::iterator it = parameters.begin(); it != parameters.end(); it++) {
- if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
- }
+ //check for optional parameter and set defaults
+ // ...at some point should added some additional type checking...
+ string commandOption = validParameter.validFile(parameters, "command", false);
+ if (commandOption == "not found") { commandOption = ""; }
+ else { command = commandOption; }
+
+ if ((option == "") && (commandOption == "")) { m->mothurOut("You must enter a command to run."); m->mothurOutEndLine(); abort = true; }
+ else if (commandOption == "") {
+ //check for outputdir and inputdir parameters
+ int commaPos = option.find_first_of(',');
+
+ //if there is a comma then grab string up to that pos
+ if (commaPos != option.npos) {
+ option = option.substr(0, commaPos);
+ }