]> git.donarmstrong.com Git - mothur.git/blobdiff - aligncommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / aligncommand.cpp
index db4e34aa69fcb04be1b3d15a39ed7013c6a2086a..304848179331ab980730713c5a35998bb54a80bc 100644 (file)
@@ -64,8 +64,7 @@ vector<string> AlignCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 AlignCommand::AlignCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["alignreport"] = tempOutNames;
@@ -79,10 +78,10 @@ AlignCommand::AlignCommand(){
 //**********************************************************************************************************************
 AlignCommand::AlignCommand(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 {
                        
@@ -279,7 +278,7 @@ void AlignCommand::help(){
 
 int AlignCommand::execute(){
        try {
-               if (abort == true) { return 0;  }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                templateDB = new AlignmentDB(templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch);
                int longestBase = templateDB->getLongestBase();