]> git.donarmstrong.com Git - mothur.git/commitdiff
added [ERROR] flag if command aborts
authorwestcott <westcott>
Tue, 8 Feb 2011 17:56:37 +0000 (17:56 +0000)
committerwestcott <westcott>
Tue, 8 Feb 2011 17:56:37 +0000 (17:56 +0000)
109 files changed:
aligncommand.cpp
aligncommand.h
amovacommand.cpp
binsequencecommand.cpp
bootstrapsharedcommand.cpp
catchallcommand.cpp
chimerabellerophoncommand.cpp
chimeraccodecommand.cpp
chimeracheckcommand.cpp
chimerapintailcommand.cpp
chimeraslayercommand.cpp
chopseqscommand.cpp
classifyotucommand.cpp
classifyseqscommand.cpp
clearcutcommand.cpp
clustercommand.cpp
clusterdoturcommand.cpp
clusterfragmentscommand.cpp
clustersplitcommand.cpp
collectcommand.cpp
collectsharedcommand.cpp
command.hpp
consensuscommand.cpp
consensusseqscommand.cpp
corraxescommand.cpp
deconvolutecommand.cpp
degapseqscommand.cpp
deuniqueseqscommand.cpp
distancecommand.cpp
engine.cpp
filterseqscommand.cpp
getgroupcommand.cpp
getgroupscommand.cpp
getlabelcommand.cpp
getlineagecommand.cpp
getlistcountcommand.cpp
getoturepcommand.cpp
getotuscommand.cpp
getrabundcommand.cpp
getrelabundcommand.cpp
getsabundcommand.cpp
getseqscommand.cpp
getsharedotucommand.cpp
hclustercommand.cpp
heatmapcommand.cpp
heatmapsimcommand.cpp
homovacommand.cpp
indicatorcommand.cpp
libshuffcommand.cpp
listseqscommand.cpp
makegroupcommand.cpp
matrixoutputcommand.cpp
mergefilecommand.cpp
mergegroupscommand.cpp
metastatscommand.cpp
mgclustercommand.cpp
nmdscommand.cpp
normalizesharedcommand.cpp
otuhierarchycommand.cpp
pairwiseseqscommand.cpp
parsefastaqcommand.cpp
parselistscommand.cpp
parsimonycommand.cpp
pcacommand.cpp
pcoacommand.cpp
phylodiversitycommand.cpp
phylotypecommand.cpp
pipelinepdscommand.cpp
pipelinepdscommand.h
preclustercommand.cpp
quitcommand.cpp
rarefactcommand.cpp
rarefactsharedcommand.cpp
readdistcommand.cpp
readdistcommand.h
readotucommand.cpp
readtreecommand.cpp
readtreecommand.h
removegroupscommand.cpp
removelineagecommand.cpp
removeotuscommand.cpp
removerarecommand.cpp
removeseqscommand.cpp
reversecommand.cpp
screenseqscommand.cpp
secondarystructurecommand.cpp
sensspeccommand.cpp
seqerrorcommand.cpp
seqsummarycommand.cpp
setdircommand.cpp
setdircommand.h
setlogfilecommand.cpp
setlogfilecommand.h
sffinfocommand.cpp
sharedcommand.cpp
shhhercommand.cpp
splitabundcommand.cpp
splitgroupscommand.cpp
subsamplecommand.cpp
summarycommand.cpp
summarysharedcommand.cpp
systemcommand.cpp
systemcommand.h
treegroupscommand.cpp
trimflowscommand.cpp
trimseqscommand.cpp
unifracunweightedcommand.cpp
unifracweightedcommand.cpp
venncommand.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();
index 1410626a42e3a407289f18565dd0e64a3d4d3cd4..169b43512375aef99a22029b35425d87d6360afb 100644 (file)
@@ -58,7 +58,8 @@ private:
        vector<string> candidateFileNames;
        vector<string> outputNames;
        
-       bool abort, flip;
+       bool abort, flip, calledHelp;
+
 };
 
 #endif
index c0b9aec10e4f8695f040e61e80910a8efeb310af..0a9b53b8af07ea837553355328aa6d00230c29f8 100644 (file)
@@ -66,8 +66,7 @@ vector<string> AmovaCommand::getValidParameters(){
 //**********************************************************************************************************************
 AmovaCommand::AmovaCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["amova"] = tempOutNames;
        }
@@ -105,12 +104,12 @@ vector<string> AmovaCommand::getRequiredFiles(){
 AmovaCommand::AmovaCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -349,7 +348,7 @@ AmovaCommand::~AmovaCommand(){}
 int AmovaCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //read design file
                designMap = new GroupMap(designfile);
index bf14d6b07b3b6ae64c20d3072abb3c3603a9e42c..81c24a33713a6a0a732f3c9e6b7cbe99e10dc02d 100644 (file)
@@ -48,8 +48,7 @@ vector<string> BinSeqCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 BinSeqCommand::BinSeqCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
        }
@@ -62,12 +61,12 @@ BinSeqCommand::BinSeqCommand(){
 BinSeqCommand::BinSeqCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -218,7 +217,7 @@ BinSeqCommand::~BinSeqCommand(){
 
 int BinSeqCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                int error = 0;
                
index b7d6c45e6e0179704a0e902c7960810e65df7eca..66a43976c8c5b6ca61090f78a216acfae99d694f 100644 (file)
@@ -34,8 +34,7 @@ vector<string> BootSharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 BootSharedCommand::BootSharedCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["tree"] = tempOutNames;
        }
@@ -71,14 +70,14 @@ vector<string> BootSharedCommand::getRequiredFiles(){
 BootSharedCommand::BootSharedCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Groups.clear();
                Estimators.clear();
                
                //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
@@ -235,7 +234,7 @@ BootSharedCommand::~BootSharedCommand(){
 int BootSharedCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                util = new SharedUtil();        
        
index b0e5eff6652a9defaa887eb7d21bb9bfe9e372a6..a462bc7df80d0a0543c6cf9722daeabf4159ca40 100644 (file)
@@ -25,6 +25,7 @@ vector<string> CatchAllCommand::getValidParameters(){
 //**********************************************************************************************************************
 CatchAllCommand::CatchAllCommand(){    
        try {
+               abort = true; calledHelp = true;
                //initialize outputTypes
                vector<string> tempOutNames;
                outputTypes["csv"] = tempOutNames;
@@ -62,11 +63,11 @@ vector<string> CatchAllCommand::getRequiredFiles(){
 CatchAllCommand::CatchAllCommand(string option)  {     
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                
                //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
@@ -173,7 +174,7 @@ void CatchAllCommand::help(){
 int CatchAllCommand::execute() {       
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //prepare full output directory
                outputDir = m->getFullPathName(outputDir);
index 5d7d6d452b2c741ad764623557f0a0d31895ba0e..22e4fe2956e18100b1e6a4920c25b9237a8d5504 100644 (file)
@@ -48,8 +48,7 @@ vector<string> ChimeraBellerophonCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ChimeraBellerophonCommand::ChimeraBellerophonCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
                outputTypes["accnos"] = tempOutNames;
@@ -63,10 +62,10 @@ ChimeraBellerophonCommand::ChimeraBellerophonCommand(){
 //***************************************************************************************************************
 ChimeraBellerophonCommand::ChimeraBellerophonCommand(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
@@ -210,7 +209,7 @@ ChimeraBellerophonCommand::~ChimeraBellerophonCommand(){    /*      do nothing      */      }
 int ChimeraBellerophonCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int i = 0; i < fastaFileNames.size(); i++) {
                        
index 223ddb23c1bec61748ce62217001dfac04b565ac..8a4ccdedea59eb676ecf4f2161e9c1719db8f72a 100644 (file)
@@ -25,6 +25,7 @@ vector<string> ChimeraCcodeCommand::getValidParameters(){
 //**********************************************************************************************************************
 ChimeraCcodeCommand::ChimeraCcodeCommand(){    
        try {
+               abort = true; calledHelp = true;
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
                outputTypes["mapinfo"] = tempOutNames;
@@ -61,10 +62,10 @@ vector<string> ChimeraCcodeCommand::getRequiredFiles(){
 //***************************************************************************************************************
 ChimeraCcodeCommand::ChimeraCcodeCommand(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
@@ -239,7 +240,7 @@ ChimeraCcodeCommand::~ChimeraCcodeCommand(){        /*      do nothing      */      }
 int ChimeraCcodeCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int s = 0; s < fastaFileNames.size(); s++) {
                                
index 3104fac58c9b6c4ff9bc1dc4870fcc77c0541853..c766b9a2dab6c2994df147423f61d14bf6f088a6 100644 (file)
@@ -47,6 +47,7 @@ vector<string> ChimeraCheckCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ChimeraCheckCommand::ChimeraCheckCommand(){    
        try {
+               abort = true; calledHelp = true;
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
        }
@@ -58,10 +59,10 @@ ChimeraCheckCommand::ChimeraCheckCommand(){
 //***************************************************************************************************************
 ChimeraCheckCommand::ChimeraCheckCommand(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
@@ -280,7 +281,7 @@ ChimeraCheckCommand::~ChimeraCheckCommand(){        /*      do nothing      */      }
 int ChimeraCheckCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int i = 0; i < fastaFileNames.size(); i++) {
                                
index c5e579e730e1cfbd3da0040359393ef08b497295..a8d2d65c6c3752fcc7ca9737e505c32850d62f7b 100644 (file)
@@ -25,6 +25,7 @@ vector<string> ChimeraPintailCommand::getValidParameters(){
 //**********************************************************************************************************************
 ChimeraPintailCommand::ChimeraPintailCommand(){        
        try {
+               abort = true; calledHelp = true;
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
                outputTypes["accnos"] = tempOutNames;
@@ -60,10 +61,10 @@ vector<string> ChimeraPintailCommand::getRequiredFiles(){
 //***************************************************************************************************************
 ChimeraPintailCommand::ChimeraPintailCommand(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
@@ -309,7 +310,7 @@ ChimeraPintailCommand::~ChimeraPintailCommand(){    /*      do nothing      */      }
 int ChimeraPintailCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int s = 0; s < fastaFileNames.size(); s++) {
                                
index a7ed94f67bb42a3805e08eb487923889c3a55af6..67b70f27cc0aa0592cd87d5b97c1471fc0edb5ff 100644 (file)
@@ -27,6 +27,7 @@ vector<string> ChimeraSlayerCommand::getValidParameters(){
 //**********************************************************************************************************************
 ChimeraSlayerCommand::ChimeraSlayerCommand(){  
        try {
+               abort = true; calledHelp = true;
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
                outputTypes["accnos"] = tempOutNames;
@@ -63,10 +64,10 @@ vector<string> ChimeraSlayerCommand::getRequiredFiles(){
 //***************************************************************************************************************
 ChimeraSlayerCommand::ChimeraSlayerCommand(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
@@ -343,7 +344,7 @@ ChimeraSlayerCommand::~ChimeraSlayerCommand(){      /*      do nothing      */      }
 int ChimeraSlayerCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int s = 0; s < fastaFileNames.size(); s++) {
                                
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";
index d3d574e470c352d046c07d52a7f1a30d02d4a902..8d9f177941549b62742f76e0b38c5337ab5b3922 100644 (file)
@@ -26,8 +26,7 @@ vector<string> ClassifyOtuCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClassifyOtuCommand::ClassifyOtuCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["constaxonomy"] = tempOutNames;
                outputTypes["taxsummary"] = tempOutNames;
@@ -63,13 +62,13 @@ vector<string> ClassifyOtuCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ClassifyOtuCommand::ClassifyOtuCommand(string option)  {
        try{
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                                
                //allow user to run help
                if (option == "help") { 
-                       help(); abort = true;
+                       help(); abort = true; calledHelp = true;
                } else {
                        //valid paramters for this command
                        string Array[] =  {"list","label","name","taxonomy","cutoff","probs","basis","reftaxonomy","group","outputdir","inputdir"};
@@ -229,7 +228,7 @@ ClassifyOtuCommand::~ClassifyOtuCommand(){}
 int ClassifyOtuCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //if user gave a namesfile then use it
                if (namefile != "") {   readNamesFile();        }
index 0a1ef8823e35f687529c70de5ef29e7d33eb91fe..2dfe05a05f9e267390c7e7656dee12d0ee1ab169 100644 (file)
@@ -30,8 +30,7 @@ vector<string> ClassifySeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClassifySeqsCommand::ClassifySeqsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
                outputTypes["taxsummary"] = tempOutNames;
@@ -68,10 +67,10 @@ vector<string> ClassifySeqsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ClassifySeqsCommand::ClassifySeqsCommand(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 {
                        
@@ -421,7 +420,7 @@ void ClassifySeqsCommand::help(){
 
 int ClassifySeqsCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if(method == "bayesian"){       classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters);           }
                else if(method == "knn"){       classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted);                               }
index a2d0aaa5331a402a538d253e4d1f00d7800fa77e..767981de36e7c3da3063ea4a9b1df696040c0e4f 100644 (file)
@@ -31,8 +31,7 @@ vector<string> ClearcutCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClearcutCommand::ClearcutCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["tree"] = tempOutNames;
                outputTypes["matrixout"] = tempOutNames;
@@ -67,10 +66,10 @@ vector<string> ClearcutCommand::getRequiredFiles(){
 /**************************************************************************************/
 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
@@ -231,7 +230,7 @@ void ClearcutCommand::help(){
 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";
index 6043d39be8d559010e156111f41a856b716cda40..5d9225b0f9ca4c6f39de259454dfc1fb92e6c919 100644 (file)
@@ -24,8 +24,7 @@ vector<string> ClusterCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClusterCommand::ClusterCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
                outputTypes["rabund"] = tempOutNames;
@@ -65,10 +64,10 @@ ClusterCommand::ClusterCommand(string option)  {
        try{
                globaldata = GlobalData::getInstance();
                
-               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
@@ -199,7 +198,7 @@ ClusterCommand::~ClusterCommand(){
 int ClusterCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                time_t estart = time(NULL);
                //int ndist = matrix->getNNodes();
index 56fbd5c0d6c2b8e9380959bd6ba97435b28fcd70..b2b31edc27b9808ea9556e345d7d817429de1321 100644 (file)
@@ -25,8 +25,7 @@ vector<string> ClusterDoturCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClusterDoturCommand::ClusterDoturCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
                outputTypes["rabund"] = tempOutNames;
@@ -65,10 +64,10 @@ vector<string> ClusterDoturCommand::getRequiredFiles(){
 ClusterDoturCommand::ClusterDoturCommand(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
@@ -189,7 +188,7 @@ ClusterDoturCommand::~ClusterDoturCommand(){}
 int ClusterDoturCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if(namefile != ""){     
                        nameMap = new NameAssignment(namefile);
index 24070d2bb0e8b8f781eece4e35e7dec4f42d6797..a8277ffb029fdd6e5f3e110614836e37292ce9a3 100644 (file)
@@ -40,8 +40,7 @@ vector<string> ClusterFragmentsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClusterFragmentsCommand::ClusterFragmentsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -77,10 +76,10 @@ vector<string> ClusterFragmentsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ClusterFragmentsCommand::ClusterFragmentsCommand(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
@@ -182,7 +181,7 @@ void ClusterFragmentsCommand::help(){
 int ClusterFragmentsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int start = time(NULL);
                
index c36e280e2925e3d07e6ef33e0756bbc039f08299..cb3fc40aaa6e42a0e802d0f47ec3f8897cc4fa61 100644 (file)
@@ -31,8 +31,7 @@ vector<string> ClusterSplitCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClusterSplitCommand::ClusterSplitCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
                outputTypes["rabund"] = tempOutNames;
@@ -72,11 +71,11 @@ vector<string> ClusterSplitCommand::getRequiredFiles(){
 ClusterSplitCommand::ClusterSplitCommand(string option)  {
        try{
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                format = "";
                
                //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
@@ -290,7 +289,7 @@ ClusterSplitCommand::~ClusterSplitCommand(){}
 int ClusterSplitCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                time_t estart;
                vector<string> listFileNames;
index 9ea55b2d6068dfda14450d82d247a428dcb9ca56..4b59296fd645fa2947a31959f299d5628b8951cf 100644 (file)
@@ -72,8 +72,7 @@ vector<string> CollectCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 CollectCommand::CollectCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["sobs"] = tempOutNames;
                outputTypes["chao"] = tempOutNames;
@@ -110,7 +109,7 @@ CollectCommand::CollectCommand(){
 CollectCommand::CollectCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Estimators.clear();
@@ -237,7 +236,7 @@ CollectCommand::~CollectCommand(){}
 int CollectCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string hadShared = "";
                if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName);  }
index 7ab15df6db6eb276c9ab2e8696d3de56dd4a6c85..21695e328c90590572a9efebc7caf562c2525c75 100644 (file)
@@ -88,8 +88,7 @@ vector<string> CollectSharedCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 CollectSharedCommand::CollectSharedCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["sharedchao"] = tempOutNames;
                outputTypes["sharedsobs"] = tempOutNames;
@@ -141,14 +140,14 @@ CollectSharedCommand::CollectSharedCommand(){
 CollectSharedCommand::CollectSharedCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Estimators.clear();
                Groups.clear();
                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -439,7 +438,7 @@ CollectSharedCommand::~CollectSharedCommand(){
 int CollectSharedCommand::execute(){
        try {
                
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //if the users entered no valid calculators don't execute command
                if (cDisplays.size() == 0) { return 0; }
index 97701aa0017ccaf821546f06e40df41cad6233e5..ddb776356a183e0c310997ea7f9cb0acfc5e5c02 100644 (file)
@@ -31,6 +31,7 @@ class Command {
                virtual ~Command() { }
        protected:
                MothurOut* m;
+               bool calledHelp;
 };
 
 #endif
index 9b72638662e4001963b9219f4c5f313010774797..9880b8dbf01f72abe4a2a50d9630a2d09d3fd6d0 100644 (file)
@@ -46,8 +46,7 @@ vector<string> ConcensusCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ConcensusCommand::ConcensusCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["tree"] = tempOutNames;
                outputTypes["nodepairs"] = tempOutNames;
@@ -62,7 +61,7 @@ ConcensusCommand::ConcensusCommand(){
 ConcensusCommand::ConcensusCommand(string fileroot)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                
                //initialize outputTypes
                vector<string> tempOutNames;
@@ -108,7 +107,7 @@ ConcensusCommand::~ConcensusCommand(){}
 int ConcensusCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                else {  
                        numNodes = t[0]->getNumNodes();
                        numLeaves = t[0]->getNumLeaves();
index 513566f0c4fd75990f781e2b4a482332cfe5ac12..482bac5dd40a62b58cb6b0eace303baab1fdeddb 100644 (file)
@@ -26,8 +26,7 @@ vector<string> ConsensusSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ConsensusSeqsCommand::ConsensusSeqsCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -64,11 +63,11 @@ vector<string> ConsensusSeqsCommand::getRequiredFiles(){
 //***************************************************************************************************************
 ConsensusSeqsCommand::ConsensusSeqsCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                
                //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
@@ -184,7 +183,7 @@ ConsensusSeqsCommand::~ConsensusSeqsCommand(){      /*      do nothing      */      }
 int ConsensusSeqsCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                readFasta();
                
index 26cdcda0178bcfdbfc8c89fbbbced8866edb796c..58fb3649887afbd9e6e6b3441650c336688c0168 100644 (file)
@@ -47,8 +47,7 @@ vector<string> CorrAxesCommand::getRequiredParameters(){
 //**********************************************************************************************************************
 CorrAxesCommand::CorrAxesCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["corr.axes"] = tempOutNames;
        }
@@ -72,11 +71,11 @@ vector<string> CorrAxesCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 CorrAxesCommand::CorrAxesCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                globaldata = GlobalData::getInstance();
                
                //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
@@ -221,7 +220,7 @@ CorrAxesCommand::~CorrAxesCommand(){}
 int CorrAxesCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                /*************************************************************************************/
                // use smart distancing to get right sharedRabund and convert to relabund if needed  //
index dd05afdd0243132497fdab828c384b287ff0b61c..6c04c1255ab94010da7cacfb409d497b4f0354d4 100644 (file)
@@ -24,8 +24,7 @@ vector<string> DeconvoluteCommand::getValidParameters(){
 //**********************************************************************************************************************
 DeconvoluteCommand::DeconvoluteCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -61,10 +60,10 @@ vector<string> DeconvoluteCommand::getRequiredFiles(){
 /**************************************************************************************/
 DeconvoluteCommand::DeconvoluteCommand(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
@@ -153,7 +152,7 @@ void DeconvoluteCommand::help(){
 int DeconvoluteCommand::execute() {    
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                //prepare filenames and open files
                string outNameFile = outputDir + m->getRootName(m->getSimpleName(inFastaName)) + "names";
index 2514ae1a21bd491ffb924700b226b103ea2ca839..5df61889747833ef27f5929d227c849ea7245769 100644 (file)
@@ -25,8 +25,7 @@ vector<string> DegapSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 DegapSeqsCommand::DegapSeqsCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
        }
@@ -61,10 +60,10 @@ vector<string> DegapSeqsCommand::getRequiredFiles(){
 //***************************************************************************************************************
 DegapSeqsCommand::DegapSeqsCommand(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
@@ -189,7 +188,7 @@ DegapSeqsCommand::~DegapSeqsCommand(){      /*      do nothing      */      }
 int DegapSeqsCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int s = 0; s < fastaFileNames.size(); s++) {
                                
index f6b32e68ead4b262c0c5a5c00dc07349ab2c455f..214359e3353f5521aa337085ce46136187d326c0 100644 (file)
@@ -25,8 +25,7 @@ vector<string> DeUniqueSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 DeUniqueSeqsCommand::DeUniqueSeqsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
        }
@@ -61,10 +60,10 @@ vector<string> DeUniqueSeqsCommand::getRequiredFiles(){
 /**************************************************************************************/
 DeUniqueSeqsCommand::DeUniqueSeqsCommand(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
@@ -153,7 +152,7 @@ void DeUniqueSeqsCommand::help(){
 int DeUniqueSeqsCommand::execute() {   
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                //prepare filenames and open files
                ofstream out;
index a3cebe27ac3a0dec63f8b21b3d1a446864350d28..3d667227ae2219347f2523ee1ff8286988299423 100644 (file)
@@ -30,8 +30,7 @@ vector<string> DistanceCommand::getValidParameters(){
 //**********************************************************************************************************************
 DistanceCommand::DistanceCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["phylip"] = tempOutNames;
                outputTypes["column"] = tempOutNames;
@@ -67,11 +66,11 @@ vector<string> DistanceCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 DistanceCommand::DistanceCommand(string option) {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                Estimators.clear();
                                
                //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
@@ -242,7 +241,7 @@ void DistanceCommand::help(){
 int DistanceCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int startTime = time(NULL);
                
index ad7a7ad73ad03660976137117b15035d2d2b4757..dd61de67d36974af09bf700879c8b59821ebd83f 100644 (file)
@@ -152,6 +152,10 @@ bool InteractEngine::getInput(){
                                        //executes valid command
                                        Command* command = cFactory->getCommand(commandName, options);
                                        quitCommandCalled = command->execute();
+                                                       
+                                       //if we aborted command
+                                       if (quitCommandCalled == 2) {  mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
                                        mout->control_pressed = 0;
                                        mout->executing = false;
                                                                                
@@ -291,7 +295,7 @@ bool BatchEngine::getInput(){
                //CommandFactory cFactory;
                int quitCommandCalled = 0;
            int count = 0;
-               while(quitCommandCalled == 0){
+               while(quitCommandCalled != 1){
                        
                        #ifdef USE_MPI
                                int pid, processors;
@@ -358,6 +362,10 @@ bool BatchEngine::getInput(){
                                        //executes valid command
                                        Command* command = cFactory->getCommand(commandName, options);
                                        quitCommandCalled = command->execute();
+                                                       
+                                       //if we aborted command
+                                       if (quitCommandCalled == 2) {  mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
                                        mout->control_pressed = 0;
                                        mout->executing = false;
                                                                                
@@ -474,7 +482,7 @@ bool ScriptEngine::getInput(){
                //CommandFactory cFactory;
                int quitCommandCalled = 0;
        
-               while(quitCommandCalled == 0){
+               while(quitCommandCalled != 1){
                        
                        #ifdef USE_MPI
                                int pid, processors;
@@ -542,6 +550,10 @@ bool ScriptEngine::getInput(){
                                        //executes valid command
                                        Command* command = cFactory->getCommand(commandName, options);
                                        quitCommandCalled = command->execute();
+                                       
+                                       //if we aborted command
+                                       if (quitCommandCalled == 2) {  mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+                                                       
                                        mout->control_pressed = 0;
                                        mout->executing = false;
                                                                        
index f5c7bd6876a9d98ed7c9dffa1e4fcd80b76005b2..6fd4e04a0e562e5ee44fd0a05fc7df9b1bfae3d4 100644 (file)
@@ -25,8 +25,7 @@ vector<string> FilterSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 FilterSeqsCommand::FilterSeqsCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["filter"] = tempOutNames;
@@ -62,11 +61,11 @@ vector<string> FilterSeqsCommand::getRequiredFiles(){
 /**************************************************************************************/
 FilterSeqsCommand::FilterSeqsCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                filterFileName = "";
                
                //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
@@ -240,7 +239,7 @@ void FilterSeqsCommand::help(){
 int FilterSeqsCommand::execute() {     
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                ifstream inFASTA;
                m->openInputFile(fastafileNames[0], inFASTA);
index 2847db149ac5e40defdbfdedfd9d99ae3df5d583..ab3ccfa36f3f2d4e6a7e1f5af6a38434640f3105 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetgroupCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetgroupCommand::GetgroupCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["bootgroup"] = tempOutNames;
        }
@@ -61,10 +60,10 @@ vector<string> GetgroupCommand::getRequiredFiles(){
 GetgroupCommand::GetgroupCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               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
@@ -135,7 +134,7 @@ GetgroupCommand::~GetgroupCommand(){
 int GetgroupCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                int num, inputData, count;
                count = 0;  
index 1832f96aed8122020b5ddf0ad5881275e3cc6481..635f68fc51a4151d7714d2934484cf4c44c1e16c 100644 (file)
@@ -27,8 +27,7 @@ vector<string> GetGroupsCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetGroupsCommand::GetGroupsCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
@@ -67,10 +66,10 @@ vector<string> GetGroupsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 GetGroupsCommand::GetGroupsCommand(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
@@ -222,7 +221,7 @@ void GetGroupsCommand::help(){
 int GetGroupsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                groupMap = new GroupMap(groupfile);
                groupMap->readMap();
index fe4387aa118487b5e60e120246b746222f93a5da..3191d5dda80670b8490203032e35170cf7642044 100644 (file)
@@ -49,10 +49,10 @@ vector<string> GetlabelCommand::getRequiredFiles(){
 GetlabelCommand::GetlabelCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               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 {
                        if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { m->mothurOut("You must read a list, sabund or rabund before you can use the get.label command."); m->mothurOutEndLine(); abort = true; }                         
@@ -90,7 +90,7 @@ GetlabelCommand::~GetlabelCommand(){
 int GetlabelCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                filename = globaldata->inputFileName;
                ifstream in;
index 8a6f47c0998202943e398fce09a9ae52edfa5eda..eee0ccad08a84f448ea47a42213673b0dd05254f 100644 (file)
@@ -27,8 +27,7 @@ vector<string> GetLineageCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetLineageCommand::GetLineageCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
@@ -68,10 +67,10 @@ vector<string> GetLineageCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 GetLineageCommand::GetLineageCommand(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
@@ -238,7 +237,7 @@ void GetLineageCommand::help(){
 int GetLineageCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (m->control_pressed) { return 0; }
                
index 1ecef653e11fe15d206b41fd958834be194455ff..78f26047e0debdf3e620b2e0179bfab12fe93354 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetListCountCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetListCountCommand::GetListCountCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["otu"] = tempOutNames;
        }
@@ -61,12 +60,12 @@ vector<string> GetListCountCommand::getRequiredFiles(){
 GetListCountCommand::GetListCountCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                                
                //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
@@ -168,7 +167,7 @@ GetListCountCommand::~GetListCountCommand(){}
 
 int GetListCountCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                globaldata->setFormat("list");
                
index 9cc99732e715d40f0ef06743bb85870a147f7036..84d3871c3d74026c8d92af7e5b66dfa03ebcba21 100644 (file)
@@ -38,8 +38,7 @@ inline bool compareGroup(repStruct left, repStruct right){
 //**********************************************************************************************************************
 GetOTURepCommand::GetOTURepCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -88,13 +87,13 @@ vector<string> GetOTURepCommand::getRequiredFiles(){
 GetOTURepCommand::GetOTURepCommand(string option)  {
        try{
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                                
                //allow user to run help
                if (option == "help") { 
-                       help(); abort = true;
+                       help(); abort = true; calledHelp = true;
                } else {
                        //valid paramters for this command
                        string Array[] =  {"fasta","list","label","name","weighted", "group", "sorted", "phylip","column","large","cutoff","precision","groups","outputdir","inputdir"};
@@ -299,7 +298,7 @@ GetOTURepCommand::~GetOTURepCommand(){}
 int GetOTURepCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                int error;
                
                if (!large) {
index fd7c8d1d4d7cc22901fc88d5b363176081fa5a14..b075cb4bb61521c15e77c1a2e6966a6966daee4c 100644 (file)
@@ -27,8 +27,7 @@ vector<string> GetOtusCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetOtusCommand::GetOtusCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["group"] = tempOutNames;
                outputTypes["list"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> GetOtusCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 GetOtusCommand::GetOtusCommand(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
@@ -182,7 +181,7 @@ void GetOtusCommand::help(){
 int GetOtusCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                groupMap = new GroupMap(groupfile);
                groupMap->readMap();
index 60f4ece3eb13de6fc68f6141c3e28ca283da694b..0b2d4ee3ed0de4daf04da29b9ad5a3595143c4b1 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetRAbundCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetRAbundCommand::GetRAbundCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["rabund"] = tempOutNames;
        }
@@ -62,12 +61,12 @@ vector<string> GetRAbundCommand::getRequiredFiles(){
 GetRAbundCommand::GetRAbundCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -158,7 +157,7 @@ GetRAbundCommand::~GetRAbundCommand(){}
 int GetRAbundCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //read first line
                read = new ReadOTUFile(globaldata->inputFileName);      
index 08e9228b215819f5e19e4d697137384294392422..5e48203f87e11fe14f54033b966b0bbd55bdde60 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetRelAbundCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetRelAbundCommand::GetRelAbundCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["relabund"] = tempOutNames;
        }
@@ -61,12 +60,12 @@ vector<string> GetRelAbundCommand::getRequiredFiles(){
 GetRelAbundCommand::GetRelAbundCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -167,7 +166,7 @@ GetRelAbundCommand::~GetRelAbundCommand(){
 int GetRelAbundCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "relabund";
                ofstream out;
index 3637d2903112154c6af122e1bac68a2a0ab65f1a..2ae807c65c7d9f4ec814564fb5823ccd3f925471 100644 (file)
@@ -24,8 +24,7 @@ vector<string> GetSAbundCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetSAbundCommand::GetSAbundCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["sabund"] = tempOutNames;
        }
@@ -61,12 +60,12 @@ vector<string> GetSAbundCommand::getRequiredFiles(){
 GetSAbundCommand::GetSAbundCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -152,7 +151,7 @@ GetSAbundCommand::~GetSAbundCommand(){
 int GetSAbundCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                //using order vector so you don't have to distinguish between the list and rabund files
                read = new ReadOTUFile(globaldata->inputFileName);      
index 9f2b5060fcaa715f9a2fd3fc484ba585d6322da9..902cc07c2d6e8768e5aa9d1bacd3d9586e9196d9 100644 (file)
@@ -26,8 +26,7 @@ vector<string> GetSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetSeqsCommand::GetSeqsCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
@@ -69,10 +68,10 @@ vector<string> GetSeqsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 GetSeqsCommand::GetSeqsCommand(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
@@ -257,7 +256,7 @@ void GetSeqsCommand::help(){
 int GetSeqsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //get names you want to keep
                readAccnos();
index 699581f4fbf7f1eb45095316147990a4836ce7ac..6ca4ee2d3dd5630c1ee38efaffe268a1e5f130c3 100644 (file)
@@ -25,8 +25,7 @@ vector<string> GetSharedOTUCommand::getValidParameters(){
 //**********************************************************************************************************************
 GetSharedOTUCommand::GetSharedOTUCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["accnos"] = tempOutNames;
@@ -65,13 +64,13 @@ GetSharedOTUCommand::GetSharedOTUCommand(string option)  {
        try {
        
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                unique = true;
                allLines = 1;
                labels.clear();
                
                //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
@@ -218,7 +217,7 @@ GetSharedOTUCommand::~GetSharedOTUCommand(){}
 int GetSharedOTUCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                groupMap = new GroupMap(groupfile);
                int error = groupMap->readMap();
index 69dbef6d15791466813ba0ecdde87f6a68a55664..94082dfc74dfe0969e769572fc6df219ecaa69d2 100644 (file)
@@ -24,8 +24,7 @@ vector<string> HClusterCommand::getValidParameters(){
 //**********************************************************************************************************************
 HClusterCommand::HClusterCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
                outputTypes["rabund"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> HClusterCommand::getRequiredFiles(){
 HClusterCommand::HClusterCommand(string option)  {
        try{
                globaldata = GlobalData::getInstance();
-               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
@@ -237,7 +236,7 @@ HClusterCommand::~HClusterCommand(){}
 int HClusterCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if(namefile != ""){     
                        globaldata->nameMap = new NameAssignment(namefile);
index 892010839f519495744e0d68518124ffa1778fae..19a320afa409e9e7be546b69c85f8c3c99e05fa6 100644 (file)
@@ -24,8 +24,7 @@ vector<string> HeatMapCommand::getValidParameters(){
 //**********************************************************************************************************************
 HeatMapCommand::HeatMapCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["svg"] = tempOutNames;
        }
@@ -62,12 +61,12 @@ vector<string> HeatMapCommand::getRequiredFiles(){
 HeatMapCommand::HeatMapCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -183,7 +182,7 @@ HeatMapCommand::~HeatMapCommand(){
 int HeatMapCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                heatmap = new HeatMap(sorted, scale, numOTU, fontSize, outputDir);
                format = globaldata->getFormat();
index 7ab178c528f40b6c5b9456880545c104701debf8..28b0221ba8458cb1a760fade14426ea6a7123568 100644 (file)
@@ -34,8 +34,7 @@ vector<string> HeatMapSimCommand::getValidParameters(){
 //**********************************************************************************************************************
 HeatMapSimCommand::HeatMapSimCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["svg"] = tempOutNames;
        }
@@ -71,14 +70,14 @@ vector<string> HeatMapSimCommand::getRequiredFiles(){
 HeatMapSimCommand::HeatMapSimCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Groups.clear();
                Estimators.clear();
                        
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -273,7 +272,7 @@ HeatMapSimCommand::~HeatMapSimCommand(){}
 int HeatMapSimCommand::execute(){
        try {
        
-               if (abort == true)  { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                heatmap = new HeatMapSim(outputDir);
                
index 86a900a721ae1cc68484256624365e4b56dd3877..32a776544aeebaf1c5ec74d6368ee7a26ca368b1 100644 (file)
@@ -66,8 +66,7 @@ vector<string> HomovaCommand::getValidParameters(){
 //**********************************************************************************************************************
 HomovaCommand::HomovaCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["homova"] = tempOutNames;
        }
@@ -105,12 +104,12 @@ vector<string> HomovaCommand::getRequiredFiles(){
 HomovaCommand::HomovaCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -349,7 +348,7 @@ HomovaCommand::~HomovaCommand(){}
 int HomovaCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //read design file
                designMap = new GroupMap(designfile);
index 143135f18f7cd61d68f9750944dd70a8493e803c..239a4bc65d7d80ddf6322eca0188550068cf758f 100644 (file)
@@ -37,8 +37,7 @@ vector<string> IndicatorCommand::getRequiredParameters(){
 //**********************************************************************************************************************
 IndicatorCommand::IndicatorCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["tree"] = tempOutNames;
                outputTypes["summary"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> IndicatorCommand::getRequiredFiles(){
 IndicatorCommand::IndicatorCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               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
@@ -199,7 +198,7 @@ IndicatorCommand::~IndicatorCommand(){}
 int IndicatorCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                //read designfile if given and set up globaldatas groups for read of sharedfiles
                if (designfile != "") {
index e7fb357b9bd3028fcbd32bf388af9bbb9b4c2847..129c9700c4f945813cbb639f028d71a57b88d7b1 100644 (file)
@@ -33,8 +33,7 @@ vector<string> LibShuffCommand::getValidParameters(){
 //**********************************************************************************************************************
 LibShuffCommand::LibShuffCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["coverage"] = tempOutNames;
                outputTypes["libshuffsummary"] = tempOutNames;
@@ -72,11 +71,11 @@ vector<string> LibShuffCommand::getRequiredFiles(){
 LibShuffCommand::LibShuffCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                Groups.clear();
                
                //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
@@ -189,7 +188,7 @@ void LibShuffCommand::help(){
 int LibShuffCommand::execute(){
        try {
                
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                savedDXYValues = form->evaluateAll();
                savedMinValues = form->getSavedMins();
index 1488cdadac766b243252e87053a0132975961884..360e1955bab31055c4ad06f71c933a4228058386 100644 (file)
@@ -26,8 +26,7 @@ vector<string> ListSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ListSeqsCommand::ListSeqsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["accnos"] = tempOutNames;
        }
@@ -63,10 +62,10 @@ vector<string> ListSeqsCommand::getRequiredFiles(){
 
 ListSeqsCommand::ListSeqsCommand(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
@@ -206,7 +205,7 @@ void ListSeqsCommand::help(){
 int ListSeqsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //read functions fill names vector
                if (fastafile != "")            {       inputFileName = fastafile;      readFasta();    }
index 12be82690fc7068e4d713353ee84d79aa6330ba7..1c04fecb477d09e0e6de73b1307a3878fcc8e4b3 100644 (file)
@@ -25,8 +25,7 @@ vector<string> MakeGroupCommand::getValidParameters(){
 //**********************************************************************************************************************
 MakeGroupCommand::MakeGroupCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["group"] = tempOutNames;
        }
@@ -63,10 +62,10 @@ vector<string> MakeGroupCommand::getRequiredFiles(){
 MakeGroupCommand::MakeGroupCommand(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 {
                        
@@ -198,7 +197,7 @@ void MakeGroupCommand::help(){
 
 int MakeGroupCommand::execute(){
        try {
-               if (abort == true) { return 0;  }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[0]); }
                        
index 02b30e3c1b172281fff8661146013ede04a41f31..baf449e34d8bac9e67ab424ba02539fb053033e6 100644 (file)
@@ -64,8 +64,7 @@ vector<string> MatrixOutputCommand::getValidParameters(){
 //**********************************************************************************************************************
 MatrixOutputCommand::MatrixOutputCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["phylip"] = tempOutNames;
        }
@@ -102,14 +101,14 @@ vector<string> MatrixOutputCommand::getRequiredFiles(){
 MatrixOutputCommand::MatrixOutputCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Groups.clear();
                Estimators.clear();
                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -312,7 +311,7 @@ MatrixOutputCommand::~MatrixOutputCommand(){
 int MatrixOutputCommand::execute(){
        try {
                
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                        
                //if the users entered no valid calculators don't execute command
                if (matrixCalculators.size() == 0) { m->mothurOut("No valid calculators."); m->mothurOutEndLine();  return 0; }
index c7e5b65e06b77107251b9f4164f4f722edaaeeb2..2b34a00b8c3961d581032dcf6b6929404428a3b4 100644 (file)
@@ -24,8 +24,7 @@ vector<string> MergeFileCommand::getValidParameters(){
 //**********************************************************************************************************************
 MergeFileCommand::MergeFileCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["merge"] = tempOutNames;
        }
@@ -61,11 +60,11 @@ vector<string> MergeFileCommand::getRequiredFiles(){
 
 MergeFileCommand::MergeFileCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                
                if(option == "help") {
                        help();
-                       abort = true; 
+                       abort = true; calledHelp = true;
                }
                else {
                        //valid paramters for this command
@@ -137,7 +136,7 @@ MergeFileCommand::~MergeFileCommand()       {       /*      do nothing      */      }
 
 int MergeFileCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                ofstream outputFile;
                m->openOutputFile(outputFileName, outputFile);
index 4738389010cda4ecc598da27e4bd52b1205a8218..c54cd1c7dd8e578126b345c68ac0ac1d8f684e19 100644 (file)
@@ -25,8 +25,7 @@ vector<string> MergeGroupsCommand::getValidParameters(){
 //**********************************************************************************************************************
 MergeGroupsCommand::MergeGroupsCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["shared"] = tempOutNames;
        }
@@ -64,12 +63,12 @@ vector<string> MergeGroupsCommand::getRequiredFiles(){
 MergeGroupsCommand::MergeGroupsCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -180,7 +179,7 @@ MergeGroupsCommand::~MergeGroupsCommand(){}
 int MergeGroupsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (outputDir == "") {  outputDir += m->hasPath(sharedfile);  }
                string outputFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "merge" +  m->getExtension(sharedfile);
index 81715e0abe84b485b96eb9997120dbe127dd6a5e..e13e37c92c3103a3aabd1a4a6a7c68db443592ef 100644 (file)
@@ -26,8 +26,7 @@ vector<string> MetaStatsCommand::getValidParameters(){
 //**********************************************************************************************************************
 MetaStatsCommand::MetaStatsCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["metastats"] = tempOutNames;
        }
@@ -65,12 +64,12 @@ vector<string> MetaStatsCommand::getRequiredFiles(){
 MetaStatsCommand::MetaStatsCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -206,7 +205,7 @@ MetaStatsCommand::~MetaStatsCommand(){}
 int MetaStatsCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                designMap = new GroupMap(designfile);
                designMap->readDesignMap();
index 3ed9bf2131a45ac7a4b0ac44d959b16bfe28cd36..4809964db6f2e3a65bd30f72d8f157fd7bc1fa44 100644 (file)
@@ -25,8 +25,7 @@ vector<string> MGClusterCommand::getValidParameters(){
 //**********************************************************************************************************************
 MGClusterCommand::MGClusterCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
                outputTypes["rabund"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> MGClusterCommand::getRequiredFiles(){
 MGClusterCommand::MGClusterCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               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
@@ -202,7 +201,7 @@ MGClusterCommand::~MGClusterCommand(){}
 int MGClusterCommand::execute(){
        try {
                
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //read names file
                if (namefile != "") {
index 28bf3978f7344fe0f405717ad80adc8851e2cffd..6596859c8c13f0e86b501d8ba62e9601ff4bf45a 100644 (file)
@@ -25,8 +25,7 @@ vector<string> NMDSCommand::getValidParameters(){
 //**********************************************************************************************************************
 NMDSCommand::NMDSCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["nmds"] = tempOutNames;
                outputTypes["stress"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> NMDSCommand::getRequiredFiles(){
 
 NMDSCommand::NMDSCommand(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
@@ -178,7 +177,7 @@ NMDSCommand::~NMDSCommand(){}
 int NMDSCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                cout.setf(ios::fixed, ios::floatfield);
                cout.setf(ios::showpoint);
index 85265015a7e6ea4de35552bd7d27d7efdc688348..c0e7c1f7f037cf1f0d87ab169408825a547c5982 100644 (file)
@@ -24,8 +24,7 @@ vector<string> NormalizeSharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 NormalizeSharedCommand::NormalizeSharedCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["shared"] = tempOutNames;
        }
@@ -62,12 +61,12 @@ vector<string> NormalizeSharedCommand::getRequiredFiles(){
 NormalizeSharedCommand::NormalizeSharedCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -185,7 +184,7 @@ NormalizeSharedCommand::~NormalizeSharedCommand(){}
 int NormalizeSharedCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "norm.shared";
                ofstream out;
index 14138de30355151035a7ddca66f5bd928e534bc5..b49af32a76c1cbb2d65ab2a5bf32555a171c5de7 100644 (file)
@@ -24,8 +24,7 @@ vector<string> OtuHierarchyCommand::getValidParameters(){
 //**********************************************************************************************************************
 OtuHierarchyCommand::OtuHierarchyCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["otuheirarchy"] = tempOutNames;
        }
@@ -60,10 +59,10 @@ vector<string> OtuHierarchyCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 OtuHierarchyCommand::OtuHierarchyCommand(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
@@ -157,7 +156,7 @@ OtuHierarchyCommand::~OtuHierarchyCommand(){}
 int OtuHierarchyCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //get listvectors that correspond to labels requested, (or use smart distancing to get closest listvector)
                vector<ListVector> lists = getListVectors();
index 7a1ba4d5e82bb78a620baa2c9abc39d834b37995..0a4edea92911866d4768328ed2f2e46cf4a089b3 100644 (file)
@@ -61,8 +61,7 @@ vector<string> PairwiseSeqsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 PairwiseSeqsCommand::PairwiseSeqsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["phylip"] = tempOutNames;
                outputTypes["column"] = tempOutNames;
@@ -75,10 +74,10 @@ PairwiseSeqsCommand::PairwiseSeqsCommand(){
 //**********************************************************************************************************************
 PairwiseSeqsCommand::PairwiseSeqsCommand(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 {
                        
@@ -268,7 +267,7 @@ void PairwiseSeqsCommand::help(){
 
 int PairwiseSeqsCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int longestBase = 2000; //will need to update this in driver if we find sequences with more bases.  hardcoded so we don't have the pre-read user fasta file.
                
index f0a7abcc3692b8e290863a71c93bcc1831e87fca..7f4fbbab1096101aa8f09931e4c9ac40e04052b1 100644 (file)
@@ -25,8 +25,7 @@ vector<string> ParseFastaQCommand::getValidParameters(){
 //**********************************************************************************************************************
 ParseFastaQCommand::ParseFastaQCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["qual"] = tempOutNames;
@@ -62,9 +61,9 @@ vector<string> ParseFastaQCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ParseFastaQCommand::ParseFastaQCommand(string option){
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                
-               if(option == "help") {  help(); abort = true; }
+               if(option == "help") {  help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -140,7 +139,7 @@ ParseFastaQCommand::~ParseFastaQCommand()   {       /*      do nothing      */      }
 
 int ParseFastaQCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //open Output Files
                string fastaFile = outputDir + m->getRootName(m->getSimpleName(fastaQFile)) + "fasta";
index 9cf5a73a56802b65bae10d1c28187f214ebcfb56..fdacc3a58fb799ba9b1fcff2497d9ba5ab562ccd 100644 (file)
@@ -25,8 +25,7 @@ vector<string> ParseListCommand::getValidParameters(){
 //**********************************************************************************************************************
 ParseListCommand::ParseListCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
        }
@@ -61,11 +60,11 @@ vector<string> ParseListCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ParseListCommand::ParseListCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                        
                //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
@@ -170,7 +169,7 @@ ParseListCommand::~ParseListCommand(){}
 int ParseListCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //set fileroot
                string fileroot = outputDir + m->getRootName(m->getSimpleName(listfile));
index c97e92ed7253cf1cdf00882a6e1155c1b86fe60a..c0de504f32f379651d15fc95767821ec9abd56c7 100644 (file)
@@ -24,8 +24,7 @@ vector<string> ParsimonyCommand::getValidParameters(){
 //**********************************************************************************************************************
 ParsimonyCommand::ParsimonyCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["parsimony"] = tempOutNames;
                outputTypes["psummary"] = tempOutNames;
@@ -61,11 +60,11 @@ vector<string> ParsimonyCommand::getRequiredFiles(){
 ParsimonyCommand::ParsimonyCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                Groups.clear();
                        
                //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
@@ -186,7 +185,7 @@ void ParsimonyCommand::help(){
 int ParsimonyCommand::execute() {
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                Progress* reading;
                reading = new Progress("Comparing to random:", iters);
index 8fb41213c7f836cb45cb89474ae8c874e96cd42e..2e8f132eefa8a491f1b5e23a2d9650da22ee1c84 100644 (file)
@@ -25,8 +25,7 @@ vector<string> PCACommand::getValidParameters(){
 //**********************************************************************************************************************
 PCACommand::PCACommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["pca"] = tempOutNames;
                outputTypes["loadings"] = tempOutNames;
@@ -63,12 +62,12 @@ vector<string> PCACommand::getRequiredFiles(){
 
 PCACommand::PCACommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                
                globaldata = GlobalData::getInstance();
                
                //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
@@ -150,7 +149,7 @@ PCACommand::~PCACommand(){}
 int PCACommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                cout.setf(ios::fixed, ios::floatfield);
                cout.setf(ios::showpoint);
index fbcb7e08779d14f28277d8b5e8d0a8ce3b088174..d8efb2551e2bb6b2f459f14ad041c188f31926da 100644 (file)
@@ -26,8 +26,7 @@ vector<string> PCOACommand::getValidParameters(){
 //**********************************************************************************************************************
 PCOACommand::PCOACommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["pcoa"] = tempOutNames;
                outputTypes["loadings"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> PCOACommand::getRequiredFiles(){
 
 PCOACommand::PCOACommand(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
@@ -149,7 +148,7 @@ PCOACommand::~PCOACommand(){}
 int PCOACommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                cout.setf(ios::fixed, ios::floatfield);
                cout.setf(ios::showpoint);
index 4eb652c9b951f0e1384eafeae722b6ea583b5790..a987594815b00a2e2aa40e177a794a99014bbe33 100644 (file)
@@ -24,8 +24,7 @@ vector<string> PhyloDiversityCommand::getValidParameters(){
 //**********************************************************************************************************************
 PhyloDiversityCommand::PhyloDiversityCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["phylodiv"] = tempOutNames;
                outputTypes["rarefy"] = tempOutNames;
@@ -63,10 +62,10 @@ vector<string> PhyloDiversityCommand::getRequiredFiles(){
 PhyloDiversityCommand::PhyloDiversityCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               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
@@ -169,7 +168,7 @@ PhyloDiversityCommand::~PhyloDiversityCommand(){}
 int PhyloDiversityCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //incase the user had some mismatches between the tree and group files we don't want group xxx to be analyzed
                for (int i = 0; i < globaldata->Groups.size(); i++) { if (globaldata->Groups[i] == "xxx") { globaldata->Groups.erase(globaldata->Groups.begin()+i);  break; }  }
index 2018170648761a91b5b9026fada7079b0b4e73e1..4b524dd09af79b7d9cc2653caec6eb9d4dfb36ad 100644 (file)
@@ -28,8 +28,7 @@ vector<string> PhylotypeCommand::getValidParameters(){
 //**********************************************************************************************************************
 PhylotypeCommand::PhylotypeCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
                outputTypes["sabund"] = tempOutNames;
@@ -66,10 +65,10 @@ vector<string> PhylotypeCommand::getRequiredFiles(){
 /**********************************************************************************************************************/
 PhylotypeCommand::PhylotypeCommand(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 {
                        
@@ -181,7 +180,7 @@ PhylotypeCommand::~PhylotypeCommand(){}
 int PhylotypeCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //reads in taxonomy file and makes all the taxonomies the same length 
                //by appending the last taxon to a given taxonomy as many times as needed to 
index f95b928621215ea6d770031ab712a0a33070c31b..84282dcc39105c7f4d560b88fcacdcb4ed4342d6 100644 (file)
@@ -49,10 +49,10 @@ vector<string> PipelineCommand::getRequiredFiles(){
 PipelineCommand::PipelineCommand(string option) {
        try {
                cFactory = CommandFactory::getInstance();
-               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 {
                        
@@ -235,7 +235,7 @@ PipelineCommand::~PipelineCommand(){}
 
 int PipelineCommand::execute(){
        try {
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int start = time(NULL);
                
index a5061599472400895d1dfc1fac41320f7a880864..289a909c9d6eef64f4ad2fe61d136592c51120b6 100644 (file)
@@ -20,7 +20,7 @@ class PipelineCommand : public Command {
        
 public:
        PipelineCommand(string);
-       PipelineCommand() {}
+       PipelineCommand() { abort = true; calledHelp = true; }
        ~PipelineCommand();
        vector<string> getRequiredParameters();
        vector<string> getValidParameters();
index 3a3aafc7c44fc3385bbb3284abbbc0b09701c13f..14409f5a0a6aa86a166f42ff6f99423777237759 100644 (file)
@@ -26,8 +26,7 @@ vector<string> PreClusterCommand::getValidParameters(){
 //**********************************************************************************************************************
 PreClusterCommand::PreClusterCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> PreClusterCommand::getRequiredFiles(){
 
 PreClusterCommand::PreClusterCommand(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
@@ -167,7 +166,7 @@ void PreClusterCommand::help(){
 int PreClusterCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int start = time(NULL);
                
index 0dd2dec189317e56518fbfafce1c93a3c7a84f1b..462fe8fbf43e7f47a93ddefeb1058095cf636f86 100644 (file)
@@ -45,10 +45,10 @@ vector<string> QuitCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 
 QuitCommand::QuitCommand(string option) {
-               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; }
 
 }
 //**********************************************************************************************************************
index cb377273ebf711d1c7ef41363178a30a4add2e31..4ab81ea4ae3186265ce08286008fc48fcbac4881 100644 (file)
@@ -62,8 +62,7 @@ vector<string> RareFactCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 RareFactCommand::RareFactCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["rarefaction"] = tempOutNames;
                outputTypes["r_chao"] = tempOutNames;
@@ -90,13 +89,13 @@ RareFactCommand::RareFactCommand(){
 RareFactCommand::RareFactCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Estimators.clear();
                                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -214,7 +213,7 @@ RareFactCommand::~RareFactCommand(){}
 int RareFactCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string hadShared = "";
                if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName);  }
index 8cf1f2fd6606f97bed2e10d0301994d769a8aa94..ea460c026e4c4ea77684893920b328288d3f9f63 100644 (file)
@@ -26,8 +26,7 @@ vector<string> RareFactSharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 RareFactSharedCommand::RareFactSharedCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["sharedrarefaction"] = tempOutNames;
                outputTypes["sharedr_nseqs"] = tempOutNames;
@@ -66,14 +65,14 @@ RareFactSharedCommand::RareFactSharedCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
                
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Estimators.clear();
                Groups.clear();
                                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -217,7 +216,7 @@ RareFactSharedCommand::~RareFactSharedCommand(){
 int RareFactSharedCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //if the users entered no valid calculators don't execute command
                if (rDisplays.size() == 0) { return 0; }
index c600eb86c969303f608b6a440dedb77af3e50b1d..630f6493fef9b542dfd8fea434f935987b6ac98f 100644 (file)
@@ -51,10 +51,10 @@ vector<string> ReadDistCommand::getRequiredFiles(){
 ReadDistCommand::ReadDistCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               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
@@ -239,7 +239,7 @@ ReadDistCommand::~ReadDistCommand(){
 int ReadDistCommand::execute(){
        try {
                
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                time_t start = time(NULL);
                size_t numDists = 0;
index 984b4a78ec40fc5b9d643cd51434ef4255d3e239..2f05ddbd3169d4cd4f204245ca2a0dd88571cb8e 100644 (file)
@@ -27,7 +27,7 @@ class GlobalData;
 class ReadDistCommand : public Command {
 public:
        ReadDistCommand(string);
-       ReadDistCommand() {}
+       ReadDistCommand() { abort = true; calledHelp = true; }
        ~ReadDistCommand();
        vector<string> getRequiredParameters();
        vector<string> getValidParameters();
index 8683fc3fa80154729ea5228fcaa38fb03726603a..67575561721451bfe172c7235bb172ed24606155 100644 (file)
@@ -24,8 +24,7 @@ vector<string> ReadOtuCommand::getValidParameters(){
 //**********************************************************************************************************************
 ReadOtuCommand::ReadOtuCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["rabund"] = tempOutNames;
                outputTypes["shared"] = tempOutNames;
@@ -62,11 +61,11 @@ vector<string> ReadOtuCommand::getRequiredFiles(){
 ReadOtuCommand::ReadOtuCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                
                //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
@@ -290,7 +289,7 @@ ReadOtuCommand::~ReadOtuCommand(){}
 int ReadOtuCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                if (globaldata->getFormat() == "shared") {
                        
index edfdf3b77e0d85ff51afce83323d0204ab987a66..05a65b736f93c376525b1cf64e2ed8275fc9c486 100644 (file)
@@ -48,10 +48,10 @@ vector<string> ReadTreeCommand::getRequiredFiles(){
 ReadTreeCommand::ReadTreeCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               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
@@ -178,7 +178,7 @@ ReadTreeCommand::~ReadTreeCommand(){
 int ReadTreeCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int readOk;
                
index 97391d0982bbadb437ebe13318c47babeca4a981..464a825d002e7e1ac3cfe7f43af91142d2a6aeb9 100644 (file)
@@ -19,7 +19,7 @@ class GlobalData;
 class ReadTreeCommand : public Command {
 public:
        ReadTreeCommand(string);
-       ReadTreeCommand() {}
+       ReadTreeCommand() { abort = true; calledHelp = true; }
        ~ReadTreeCommand();
        vector<string> getRequiredParameters();
        vector<string> getValidParameters();
index 2c98e814220432e2d27cf82499235a3fe3e928bb..4462b52863f235cb8436d0db77fe5a3698823534 100644 (file)
@@ -27,8 +27,7 @@ vector<string> RemoveGroupsCommand::getValidParameters(){
 //**********************************************************************************************************************
 RemoveGroupsCommand::RemoveGroupsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
@@ -67,10 +66,10 @@ vector<string> RemoveGroupsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 RemoveGroupsCommand::RemoveGroupsCommand(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
@@ -222,7 +221,7 @@ void RemoveGroupsCommand::help(){
 int RemoveGroupsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                groupMap = new GroupMap(groupfile);
                groupMap->readMap();
index 0a5c5c7135941843452e2100977cfff9df3d4b19..6e43b1025cae8ccc828e7e48c51b63304200dc62 100644 (file)
@@ -26,8 +26,7 @@ vector<string> RemoveLineageCommand::getValidParameters(){
 //**********************************************************************************************************************
 RemoveLineageCommand::RemoveLineageCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
@@ -67,10 +66,10 @@ vector<string> RemoveLineageCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 RemoveLineageCommand::RemoveLineageCommand(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
@@ -237,7 +236,7 @@ void RemoveLineageCommand::help(){
 int RemoveLineageCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (m->control_pressed) { return 0; }
                
index 1a7d3bd8eb5c1a876e6edc6282418dd2d1ce3b30..347bb0870f3fde2ab71c86c5b67918fad4a4904c 100644 (file)
@@ -27,8 +27,7 @@ vector<string> RemoveOtusCommand::getValidParameters(){
 //**********************************************************************************************************************
 RemoveOtusCommand::RemoveOtusCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["group"] = tempOutNames;
                outputTypes["list"] = tempOutNames;
@@ -64,10 +63,10 @@ vector<string> RemoveOtusCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 RemoveOtusCommand::RemoveOtusCommand(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
@@ -182,7 +181,7 @@ void RemoveOtusCommand::help(){
 int RemoveOtusCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                groupMap = new GroupMap(groupfile);
                groupMap->readMap();
index 0ba90f38eac435c09ca922a5cffaf7943da500ad..0c656a053a7293f4ef7fa3325edead27339c9196 100644 (file)
@@ -28,8 +28,7 @@ vector<string> RemoveRareCommand::getValidParameters(){
 //**********************************************************************************************************************
 RemoveRareCommand::RemoveRareCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["rabund"] = tempOutNames;
                outputTypes["sabund"] = tempOutNames;
@@ -69,11 +68,11 @@ vector<string> RemoveRareCommand::getRequiredFiles(){
 RemoveRareCommand::RemoveRareCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                
                //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
@@ -227,7 +226,7 @@ void RemoveRareCommand::help(){
 int RemoveRareCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (m->control_pressed) { return 0; }
                
index 17de5a8fcc91b0bc062c2f4fbf2164fdfccef8e5..81c42f6e426a2b59cb074a2d28cbed1c6e529c0b 100644 (file)
@@ -26,8 +26,7 @@ vector<string> RemoveSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 RemoveSeqsCommand::RemoveSeqsCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
@@ -68,10 +67,10 @@ vector<string> RemoveSeqsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 RemoveSeqsCommand::RemoveSeqsCommand(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
@@ -249,7 +248,7 @@ void RemoveSeqsCommand::help(){
 int RemoveSeqsCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //get names you want to keep
                readAccnos();
index 7b58162d20d8ac1910323c2946f7f8b4c05299af..d20f4af0acd4861cea64688e6e05460e42cbaf75 100644 (file)
@@ -25,8 +25,7 @@ vector<string> ReverseSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ReverseSeqsCommand::ReverseSeqsCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
        }
@@ -62,10 +61,10 @@ vector<string> ReverseSeqsCommand::getRequiredFiles(){
 
 ReverseSeqsCommand::ReverseSeqsCommand(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
@@ -144,7 +143,7 @@ ReverseSeqsCommand::~ReverseSeqsCommand(){  /*      do nothing      */      }
 int ReverseSeqsCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                ifstream inFASTA;
                m->openInputFile(fasta, inFASTA);
index 65b5956cce5c0a6418d5d9524218b35b0b335aa8..150a27e54273dfcf7c61d8c1582efe794e0362ba 100644 (file)
@@ -26,8 +26,7 @@ vector<string> ScreenSeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ScreenSeqsCommand::ScreenSeqsCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -67,10 +66,10 @@ vector<string> ScreenSeqsCommand::getRequiredFiles(){
 
 ScreenSeqsCommand::ScreenSeqsCommand(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
@@ -247,7 +246,7 @@ ScreenSeqsCommand::~ScreenSeqsCommand(){    /*      do nothing      */      }
 int ScreenSeqsCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //if the user want to optimize we need to no the 90% mark
                vector<unsigned long int> positions;
index 26bd35444d866132fd37c34fc3e0d8fd4cf84c40..c9002cab4a458c1ef9fbb3a2acb85706e01513dc 100644 (file)
@@ -25,8 +25,7 @@ vector<string> AlignCheckCommand::getValidParameters(){
 //**********************************************************************************************************************
 AlignCheckCommand::AlignCheckCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["aligncheck"] = tempOutNames;
        }
@@ -62,11 +61,11 @@ vector<string> AlignCheckCommand::getRequiredFiles(){
 
 AlignCheckCommand::AlignCheckCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                haderror = 0;
                        
                //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
@@ -155,7 +154,7 @@ void AlignCheckCommand::help(){
 int AlignCheckCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //get secondary structure info.
                readMap();
index 045736d1021760f3afc7a772ea404def8a3e0d70..6a22fd686096e83308faf7a68e98e9391d722fe0 100644 (file)
@@ -24,8 +24,7 @@ vector<string> SensSpecCommand::getValidParameters(){
 //**********************************************************************************************************************
 SensSpecCommand::SensSpecCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["sensspec"] = tempOutNames;
        }
@@ -62,10 +61,10 @@ vector<string> SensSpecCommand::getRequiredFiles(){
 SensSpecCommand::SensSpecCommand(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 {
                        string temp;
@@ -208,7 +207,7 @@ SensSpecCommand::~SensSpecCommand(){        /*      do nothing      */      }
 
 int SensSpecCommand::execute(){
        try{
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                setUpOutput();
                outputNames.push_back(sensSpecFileName); outputTypes["sensspec"].push_back(sensSpecFileName);
index d2c0fcb64f92652a14dee26e40e89ae5dc9a19dd..00f78626b6270455f5a8f35464923fe72e9ff527 100644 (file)
@@ -27,8 +27,7 @@ vector<string> SeqErrorCommand::getValidParameters(){
 //**********************************************************************************************************************
 SeqErrorCommand::SeqErrorCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["error.summary"] = tempOutNames;
                outputTypes["error.seq"] = tempOutNames;
@@ -73,10 +72,10 @@ vector<string> SeqErrorCommand::getRequiredFiles(){
 SeqErrorCommand::SeqErrorCommand(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 {
                        string temp;
@@ -231,7 +230,7 @@ SeqErrorCommand::~SeqErrorCommand(){
 
 int SeqErrorCommand::execute(){
        try{
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                string errorSummaryFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".error.summary";
                m->openOutputFile(errorSummaryFileName, errorSummaryFile);
index 7edb717853461ba4cd23f9845b36880dd9ce38ae..7da424c1ce0520fb8125915abb006126e93eeeec 100644 (file)
@@ -25,8 +25,7 @@ vector<string> SeqSummaryCommand::getValidParameters(){
 //**********************************************************************************************************************
 SeqSummaryCommand::SeqSummaryCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["summary"] = tempOutNames;
        }
@@ -62,10 +61,10 @@ vector<string> SeqSummaryCommand::getRequiredFiles(){
 
 SeqSummaryCommand::SeqSummaryCommand(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
@@ -148,7 +147,7 @@ SeqSummaryCommand::~SeqSummaryCommand(){    /*      do nothing      */      }
 int SeqSummaryCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string summaryFile = outputDir + m->getSimpleName(fastafile) + ".summary";
                                
index 214bd172e80208f246bede7978ad69329f6e23db..a76db24282e2c00032ec747de2d1d5decf20e095 100644 (file)
@@ -47,10 +47,10 @@ vector<string> SetDirectoryCommand::getRequiredFiles(){
 
 SetDirectoryCommand::SetDirectoryCommand(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
@@ -117,7 +117,7 @@ SetDirectoryCommand::~SetDirectoryCommand(){}
 int SetDirectoryCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                commandFactory = CommandFactory::getInstance();
                
index 1afab07244ef9f9464b98224249fea447f00402e..6263c5eb9a55c391a0a91adf657b82d2be97d6cf 100644 (file)
@@ -20,7 +20,7 @@ class SetDirectoryCommand : public Command {
        
 public:
        SetDirectoryCommand(string);
-       SetDirectoryCommand() {}
+       SetDirectoryCommand() { abort = true; calledHelp = true; }
        ~SetDirectoryCommand();
        vector<string> getRequiredParameters();
        vector<string> getValidParameters();
index b99b833a5651c80d4b54b1d957810303fe65b199..f57dfafeacd9caae5711f56c17c3102e083567f0 100644 (file)
@@ -48,10 +48,10 @@ vector<string> SetLogFileCommand::getRequiredFiles(){
 
 SetLogFileCommand::SetLogFileCommand(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
@@ -103,7 +103,7 @@ SetLogFileCommand::~SetLogFileCommand(){}
 int SetLogFileCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                commandFactory = CommandFactory::getInstance();
                
index d2b5c3d63bc3490d6a478fd3ced457706422f2ec..e0555d00a185559841902dc232a4a603819df0dc 100644 (file)
@@ -19,7 +19,7 @@ class SetLogFileCommand : public Command {
        
 public:
        SetLogFileCommand(string);
-       SetLogFileCommand() {}
+       SetLogFileCommand() { abort = true; calledHelp = true; }
        ~SetLogFileCommand();
        vector<string> getRequiredParameters();
        vector<string> getValidParameters();
index c9bc469cf80c0871e7a4e8868ae1866960f4afcd..4a9271ce94df57f99e9734ba2b4d9d30d20872e9 100644 (file)
@@ -25,8 +25,7 @@ vector<string> SffInfoCommand::getValidParameters(){
 //**********************************************************************************************************************
 SffInfoCommand::SffInfoCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["flow"] = tempOutNames;
@@ -65,11 +64,11 @@ vector<string> SffInfoCommand::getRequiredFiles(){
 
 SffInfoCommand::SffInfoCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                hasAccnos = 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
@@ -279,7 +278,7 @@ SffInfoCommand::~SffInfoCommand(){}
 int SffInfoCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int s = 0; s < filenames.size(); s++) {
                        
index c252b4fecc9cebad935e0970fa88aaf5d43e7ac0..ec6b1d3828c38019085101abaa4a0599c539f974 100644 (file)
@@ -27,7 +27,7 @@ vector<string> SharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 SharedCommand::SharedCommand(){        
        try {           
-
+               
                //initialize outputTypes
                vector<string> tempOutNames;
                outputTypes["rabund"] = tempOutNames;
index ffddb8cfc9de4dd92feb4966dd8d31477e1363fa..e2f2636e491294a7e260e34340cef1e4e8273d40 100644 (file)
@@ -48,7 +48,7 @@ vector<string> ShhherCommand::getValidParameters(){
 
 ShhherCommand::ShhherCommand(){        
        try {
-               abort = true;
+               abort = true; calledHelp = true;
                
                //initialize outputTypes
                vector<string> tempOutNames;
@@ -101,11 +101,11 @@ ShhherCommand::ShhherCommand(string option) {
 #endif
                
                
-               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 {
                        
@@ -237,6 +237,8 @@ void ShhherCommand::help(){
 #ifdef USE_MPI
 int ShhherCommand::execute(){
        try {
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
+               
                int tag = 1976;
                MPI_Status status; 
 
index a8ca812e0e0cb6854fd3c806e8e26249eb9400a2..d0f925eb0ae26d98cd5f8098eca3ade34fc9e5d4 100644 (file)
@@ -24,8 +24,7 @@ vector<string> SplitAbundCommand::getValidParameters(){
 //**********************************************************************************************************************
 SplitAbundCommand::SplitAbundCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["list"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -64,11 +63,11 @@ vector<string> SplitAbundCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 SplitAbundCommand::SplitAbundCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                        
                //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
@@ -233,7 +232,7 @@ SplitAbundCommand::~SplitAbundCommand(){
 int SplitAbundCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (listfile != "") { //you are using a listfile to determine abundance
                        if (outputDir == "") { outputDir = m->hasPath(listfile); }
index 3fa7d047b372a1c4335b9446c1b34d2aac9b702a..d389d8907bfaffde16b8ca9eac4dad0061341831 100644 (file)
@@ -48,8 +48,7 @@ vector<string> SplitGroupCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 SplitGroupCommand::SplitGroupCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["name"] = tempOutNames;
@@ -62,10 +61,10 @@ SplitGroupCommand::SplitGroupCommand(){
 //**********************************************************************************************************************
 SplitGroupCommand::SplitGroupCommand(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
@@ -171,7 +170,7 @@ SplitGroupCommand::~SplitGroupCommand(){ }
 int SplitGroupCommand::execute(){
        try {
        
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                groupMap = new GroupMap(groupfile);
                groupMap->readMap();
index 2a3d138d77497d545a04c259f55dae41d3191413..6b0e4f991f01f7d3a6e323f2670819e00ded79f9 100644 (file)
@@ -25,8 +25,7 @@ vector<string> SubSampleCommand::getValidParameters(){
 //**********************************************************************************************************************
 SubSampleCommand::SubSampleCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["shared"] = tempOutNames;
                outputTypes["list"] = tempOutNames;
@@ -68,12 +67,12 @@ vector<string> SubSampleCommand::getRequiredFiles(){
 SubSampleCommand::SubSampleCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -279,7 +278,7 @@ SubSampleCommand::~SubSampleCommand(){}
 int SubSampleCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (sharedfile != "")   {   getSubSampleShared();       }
                if (m->control_pressed) {  for (int i = 0; i < outputNames.size(); i++) {       remove(outputNames[i].c_str()); return 0; } }
index e67659f50db215490313062d442336afbd2f25e1..fbe7964e67f7eb52600bbab1bde5dc28d3ef3a1f 100644 (file)
@@ -49,8 +49,7 @@ vector<string> SummaryCommand::getValidParameters(){
 //**********************************************************************************************************************
 SummaryCommand::SummaryCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["summary"] = tempOutNames;
        }
@@ -87,13 +86,13 @@ vector<string> SummaryCommand::getRequiredFiles(){
 SummaryCommand::SummaryCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Estimators.clear();
                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -194,7 +193,7 @@ SummaryCommand::~SummaryCommand(){}
 int SummaryCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string hadShared = "";
                if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName);  }
index 1211ea964849ed5f06706105d033fe8e7ec85816..b5214448cd2a5e8f8af0b70bfc700ee05465d4af 100644 (file)
@@ -65,8 +65,7 @@ vector<string> SummarySharedCommand::getValidParameters(){
 //**********************************************************************************************************************
 SummarySharedCommand::SummarySharedCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["summary"] = tempOutNames;
        }
@@ -103,13 +102,13 @@ vector<string> SummarySharedCommand::getRequiredFiles(){
 SummarySharedCommand::SummarySharedCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Estimators.clear();
                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -317,7 +316,7 @@ SummarySharedCommand::~SummarySharedCommand(){
 int SummarySharedCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                ofstream outputFileHandle, outAll;
                string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "shared.summary";
index fb250d7fe96cb4ed38df8c0ce33d1c7e17911945..abc07d0743a0a3e8f7172c27fe4094571abb3d5c 100644 (file)
@@ -46,10 +46,10 @@ vector<string> SystemCommand::getRequiredFiles(){
 
 SystemCommand::SystemCommand(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 {
                        if (option == "") { m->mothurOut("You must enter a command to run."); m->mothurOutEndLine(); abort = true; }
@@ -92,7 +92,7 @@ void SystemCommand::help(){
 int SystemCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                system(command.c_str());
                
index 3b48642aeec3b1cb5e4fc9e1a24d152d09dccc94..55b772b71ddaa62767746d7543f61ae09a5b5e39 100644 (file)
@@ -18,7 +18,7 @@ class SystemCommand : public Command {
        public:
        
                SystemCommand(string);  
-               SystemCommand() {}
+               SystemCommand() { abort = true; calledHelp = true; }
                ~SystemCommand(){}
                vector<string> getRequiredParameters();
                vector<string> getValidParameters();
index adf140a02a00a7133fbcc14de5bc510d6aeae140..a31c15192f1f27dcc1b84ddf114d0dcf485d41a3 100644 (file)
@@ -65,7 +65,7 @@ vector<string> TreeGroupCommand::getValidParameters(){
 //**********************************************************************************************************************
 TreeGroupCommand::TreeGroupCommand(){  
        try {
-               abort = true;
+               abort = true; calledHelp = true;
                globaldata = GlobalData::getInstance();
                //initialize outputTypes
                vector<string> tempOutNames;
@@ -104,14 +104,14 @@ vector<string> TreeGroupCommand::getRequiredFiles(){
 TreeGroupCommand::TreeGroupCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                Groups.clear();
                Estimators.clear();
                
                //allow user to run help
-               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+               if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -380,7 +380,7 @@ TreeGroupCommand::~TreeGroupCommand(){
 int TreeGroupCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (format == "sharedfile") {
                        //if the users entered no valid calculators don't execute command
index e4d0165d136da966addcf3f235a162cad9f5baa1..5c5d28b0390470ae05833f177fba7f7d1012e051 100644 (file)
@@ -65,8 +65,7 @@ vector<string> TrimFlowsCommand::getRequiredFiles(){
 
 TrimFlowsCommand::TrimFlowsCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["flow"] = tempOutNames;
                outputTypes["fasta"] = tempOutNames;
@@ -101,11 +100,11 @@ void TrimFlowsCommand::help(){
 TrimFlowsCommand::TrimFlowsCommand(string option)  {
        try {
                
-               abort = false;
+               abort = false; calledHelp = false;   
                comboStarts = 0;
                
                //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
@@ -250,7 +249,7 @@ TrimFlowsCommand::TrimFlowsCommand(string option)  {
 int TrimFlowsCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                string trimFlowFileName = outputDir + m->getRootName(m->getSimpleName(flowFileName)) + "trim.flow";
                outputNames.push_back(trimFlowFileName); outputTypes["flow"].push_back(trimFlowFileName);
index 7267b91da4d2ec193508579e8226c33d6758e9c7..45de8d62df230820f35352c71f96d13db4a6cb0a 100644 (file)
@@ -31,8 +31,7 @@ vector<string> TrimSeqsCommand::getValidParameters(){
 
 TrimSeqsCommand::TrimSeqsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
                outputTypes["qual"] = tempOutNames;
@@ -76,11 +75,11 @@ vector<string> TrimSeqsCommand::getRequiredFiles(){
 TrimSeqsCommand::TrimSeqsCommand(string option)  {
        try {
                
-               abort = false;
+               abort = false; calledHelp = false;   
                comboStarts = 0;
                
                //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
@@ -316,7 +315,7 @@ TrimSeqsCommand::~TrimSeqsCommand(){        /*      do nothing      */      }
 int TrimSeqsCommand::execute(){
        try{
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                numFPrimers = 0;  //this needs to be initialized
                numRPrimers = 0;
index 79ee042a9ac883ddadbfef057dff813a4e51cf2a..ccd5aa4995392ab9f306fa986f6fc8169e08903a 100644 (file)
@@ -25,8 +25,7 @@ vector<string> UnifracUnweightedCommand::getValidParameters(){
 UnifracUnweightedCommand::UnifracUnweightedCommand(){  
        try {
                globaldata = GlobalData::getInstance();
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["unweighted"] = tempOutNames;
                outputTypes["uwsummary"] = tempOutNames;
@@ -66,11 +65,11 @@ vector<string> UnifracUnweightedCommand::getRequiredFiles(){
 UnifracUnweightedCommand::UnifracUnweightedCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                Groups.clear();
                        
                //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
@@ -191,7 +190,7 @@ void UnifracUnweightedCommand::help(){
 int UnifracUnweightedCommand::execute() {
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int start = time(NULL);
                
index bee10cb4e9954f56960c96e7efe8904958d67c97..8745a892b9a24db666d2356b4adf6f19065470d5 100644 (file)
@@ -24,8 +24,7 @@ vector<string> UnifracWeightedCommand::getValidParameters(){
 //**********************************************************************************************************************
 UnifracWeightedCommand::UnifracWeightedCommand(){      
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["weighted"] = tempOutNames;
                outputTypes["wsummary"] = tempOutNames;
@@ -65,11 +64,11 @@ vector<string> UnifracWeightedCommand::getRequiredFiles(){
 UnifracWeightedCommand::UnifracWeightedCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                Groups.clear();
                        
                //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
@@ -181,7 +180,7 @@ void UnifracWeightedCommand::help(){
 int UnifracWeightedCommand::execute() {
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                int start = time(NULL);
                
index 7601ed8e667b10e2b2cd6eaf48c8f5ce365cc6f0..5cc0fea3affdfa6d021ff93bef964f478400f5bc 100644 (file)
@@ -33,8 +33,7 @@ vector<string> VennCommand::getValidParameters(){
 //**********************************************************************************************************************
 VennCommand::VennCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["svg"] = tempOutNames;
        }
@@ -71,12 +70,12 @@ vector<string> VennCommand::getRequiredFiles(){
 VennCommand::VennCommand(string option)  {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                        
                //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
@@ -243,7 +242,7 @@ VennCommand::~VennCommand(){
 int VennCommand::execute(){
        try {
        
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                string lastLabel;