BUStools / bustools

Tools for working with BUS files
https://bustools.github.io/
BSD 2-Clause "Simplified" License
92 stars 23 forks source link

Providing an unrecognized option should result in an error (but doesn't) #89

Open yfarjoun opened 1 year ago

yfarjoun commented 1 year ago

I've been burned by this...

Currently, bustools will cheerfully ignore options that it doesn't recognize. The only effect will be one line in stderr but if it can run without that option it will do its best.

I had the wrong version of bustools (0.39.3) and I called it with --em and since it was in a pipeline and the exit code was 0, everything succeeded and I was looking at single-mapped counts thinking that they were multi_em counts....

I would like propose that if bustools finds an option it doesn't know what to do with, it would emit an error, and promptly exit with a non-zero exit-code.

Example with the latest version of bustools (0.42.0):

$ bustools count --emx -e translation.txt -t transcripts.txt --genecounts -o test output.sorted.bus
count: unrecognized option '--emx'
$ echo $?
0

(and the output files have been created...)

yfarjoun commented 1 year ago

Any thoughts about this? I can try to submit a PR if the direction is acceptable.

Yenaled commented 1 year ago

If you submit a PR, I can put it into the next release of BUStools (likely 0.43.1).

yfarjoun commented 1 year ago

done.

nh13 commented 1 year ago

I would welcome this! Helps the user not tie themselves in knots