]> git.donarmstrong.com Git - mothur.git/blobdiff - chopseqscommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / chopseqscommand.cpp
index 31fe64f232919ec714eecb3227e2ee946d0c9c12..1ebb1f4b631f21d02596aa3e1e528d27cb3587df 100644 (file)
@@ -25,8 +25,7 @@ vector<string> ChopSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ChopSeqsCommand::ChopSeqsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["accnos"] = tempOutNames;
@@ -62,10 +61,10 @@ vector<string> ChopSeqsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ChopSeqsCommand::ChopSeqsCommand(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
@@ -156,7 +155,7 @@ void ChopSeqsCommand::help(){
 int ChopSeqsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string outputFileName = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "chop.fasta";
                string outputFileNameAccnos = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "chop.accnos";