arq5x/bedtools — pull request #22 by agordon (2012-06-06 17:19:03+00:00)
Title: BamToBed: properly fail on non-existing input files.

Hi Aaron,

currently, BamToBed succeeds (exit code 0) if the input file doesn't exist (spent an hour debugging a pipeline script until a realized it's such a simple thing...)

This patch adds proper error message and exit code.

Before:
===
$ bedtools bamtobed -i non_existing_file.bam && echo ok
ok
===

After
====
$ bedtools bamtobed -i non_existing_file.bam && echo ok
Failed to open BAM file non_existing_file.bam
====