arq5x / bedtools2

bedtools - the swiss army knife for genome arithmetic
MIT License
928 stars 287 forks source link

Wrong exit code for bedtools merge #732

Open hisakatha opened 5 years ago

hisakatha commented 5 years ago

Hi, I'd like to report that some errors in bedtools merge wrongly returns exit code 0. I confirmed that make && make test passed.

> printf 'chrI\t10\t20\nchrI\t15\t30\n' > simple3.bed
> cat simple3.bed 
chrI    10      20
chrI    15      30
> bedtools --version
bedtools v2.28.0
> bedtools merge -i simple3.bed
chrI    10      30
> bedtools merge -i simple3.bed -c 99 -o distinct

*****
***** ERROR: Requested column 99, but database file simple3.bed only has fields 1 - 3.
> echo $?
0

I'm sorry, but I couldn't find where to fix, so I cannot send a pull request.

dariober commented 5 years ago

Hello- The same seems to happen with groupBy 2.28.0, exit code should be non-zero:

> echo "foo" | groupBy -g 2 -c 2 -o mean

*****
***** ERROR: Requested column 2, but database file - only has fields 1 - 1.

> echo $?
0
arq5x commented 5 years ago

Thanks for reporting, will look into this.