]> git.donarmstrong.com Git - bamtools.git/commitdiff
Fixed : improper exit code from FilterTool
authorderek <derekwbarnett@gmail.com>
Mon, 6 Dec 2010 21:30:13 +0000 (16:30 -0500)
committerderek <derekwbarnett@gmail.com>
Mon, 6 Dec 2010 21:30:13 +0000 (16:30 -0500)
src/toolkit/bamtools_filter.cpp

index b57cf0534d1ba4dfd15acd26d5f4dadf34148453..2b8b45e7fde99069ae3680f720591911ca7b9616 100644 (file)
@@ -736,7 +736,7 @@ bool FilterTool::FilterToolPrivate::Run(void) {
 
     // initialize defined properties & user-specified filters
     // quit if failed
-    if ( !SetupFilters() ) return 1;
+    if ( !SetupFilters() ) return false;
 
     // open reader without index
     BamMultiReader reader;
@@ -779,7 +779,7 @@ bool FilterTool::FilterToolPrivate::Run(void) {
             // if error
             if ( !openedOK ) {
                 cerr << "ERROR: Could not open input BAM file(s)... Aborting." << endl;
-                return 1;
+               return false;
             }
             
             // if index data available, we can use SetRegion
@@ -789,7 +789,7 @@ bool FilterTool::FilterToolPrivate::Run(void) {
                 if ( !reader.SetRegion(region.LeftRefID, region.LeftPosition, region.RightRefID, region.RightPosition) ) {
                     cerr << "ERROR: Region requested, but could not set BamReader region to REGION: " << m_settings->Region << " Aborting." << endl;
                     reader.Close();
-                    return 1;
+                   return false;
                 } 
               
                 // everything checks out, just iterate through specified region, filtering alignments
@@ -817,14 +817,14 @@ bool FilterTool::FilterToolPrivate::Run(void) {
             cerr << "ERROR: Could not parse REGION - " << m_settings->Region << endl;
             cerr << "Be sure REGION is in valid format (see README) and that coordinates are valid for selected references" << endl;
             reader.Close();
-            return 1;
+           return false;
         }
     }
 
     // clean up & exit
     reader.Close();
     writer.Close();
-    return 0;
+    return true;
 }
 
 bool FilterTool::FilterToolPrivate::SetupFilters(void) {