Skip to content

Commit

Permalink
Print licensing info in --version and usage
Browse files Browse the repository at this point in the history
The license under which a bcftools executable may be distributed
depends on whether it uses the GNU Scientific Library (which is
currently equivalent to whether it includes the polysomy command).

Display the license in --version output according to the conventions
at http://www.gnu.org/prep/standards/html_node/_002d_002dversion.html
and also display it in usage output in a GSL-using executable.
  • Loading branch information
jmarshall committed Oct 14, 2014
1 parent a74a887 commit ba7cfa2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ static void usage(FILE *fp)
{
fprintf(fp, "\n");
fprintf(fp, "Program: bcftools (Tools for variant calling and manipulating VCFs and BCFs)\n");
#if PSMY
fprintf(fp, "License: GNU GPLv3+, due to use of the GNU Scientific Library\n");
#endif
fprintf(fp, "Version: %s (using htslib %s)\n", bcftools_version(), hts_version());
fprintf(fp, "\n");
fprintf(fp, "Usage: bcftools <command> <argument>\n");
Expand Down Expand Up @@ -217,6 +220,14 @@ int main(int argc, char *argv[])

if (strcmp(argv[1], "version") == 0 || strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-v") == 0) {
printf("bcftools %s\nUsing htslib %s\nCopyright (C) 2014 Genome Research Ltd.\n", bcftools_version(), hts_version());
#if PSMY
printf(
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n");
#else
printf("License Expat: The MIT/Expat license\n");
#endif
return 0;
}
else if (strcmp(argv[1], "--version-only") == 0) {
Expand Down

0 comments on commit ba7cfa2

Please sign in to comment.