//**********************************************************************************************************************
ClearcutCommand::ClearcutCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["tree"] = tempOutNames;
outputTypes["matrixout"] = tempOutNames;
/**************************************************************************************/
ClearcutCommand::ClearcutCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int ClearcutCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//prepare filename
string outputName = outputDir + m->getRootName(m->getSimpleName(inputFile)) + "tre";
delete[] clearcutParameters;
if (!stdoutWanted) {
+
+ //set first tree file as new current treefile
+ string currentTree = "";
+ itTypes = outputTypes.find("tree");
+ if (itTypes != outputTypes.end()) {
+ if ((itTypes->second).size() != 0) { currentTree = (itTypes->second)[0]; m->setTreeFile(currentTree); }
+ }
+
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }