lh3 / bwa

Burrow-Wheeler Aligner for short-read alignment (see minimap2 for long-read alignment)
GNU General Public License v3.0
1.55k stars 556 forks source link

Implement -v/--version option #202

Closed fbartusch closed 5 years ago

fbartusch commented 6 years ago

Hello,

Tools usually return a version string if a user calls the tools with the -v/--version flag. BWA seems not to implement this. I'm aware of the fact, that BWA returns the version if I simply call

$ bwa
Program: bwa (alignment via Burrows-Wheeler transformation)
Version: 0.7.17-r1188
Contact: Heng Li <lh3@sanger.ac.uk>
[...]

I'm writing a tool that automatically generates provenance information for executed commands and checks among others the version of the used tool via the -v/--version flags. Thus it would be nice to add this flag to the next release.

stolarczyk commented 3 years ago

+1 for this. I have a smilar use case

stolarczyk commented 3 years ago

for posterity, you can do this like so:

bwa 2>&1 | awk 'NR==3{print $2}'

but it feels hacky to parse stderr, --version option would be much better.