forked from VertebrateResequencing/pbwt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request richarddurbin#24 from mcshane/feature/version2
print pbwt version and command line (second try)
- Loading branch information
Showing
6 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ utils | |
*.exe | ||
*.out | ||
*.app | ||
|
||
# Version file | ||
/version.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
*/ | ||
|
||
#include "pbwt.h" | ||
#include "version.h" | ||
|
||
/*********************************************************/ | ||
|
||
|
@@ -166,6 +167,11 @@ static void recordCommandLine (int argc, char *argv[]) | |
#define FOPEN(name,mode) if (!strcmp (argv[1], "-")) fp = !strcmp(mode,"r") ? stdin : stdout ; else if (!(fp = fopen (argv[1],mode))) die ("failed to open %s file", name, argv[1]) | ||
#define FCLOSE if (strcmp(argv[1], "-")) fclose(fp) | ||
|
||
const char *pbwtCommitHash(void) | ||
{ | ||
return PBWT_COMMIT_HASH ; | ||
} | ||
|
||
int main (int argc, char *argv[]) | ||
{ | ||
FILE *fp ; | ||
|
@@ -179,7 +185,11 @@ int main (int argc, char *argv[]) | |
recordCommandLine (argc, argv) ; | ||
|
||
if (!argc) /* print help */ | ||
{ fprintf (stderr, "Usage: pbwt [ -<command> [options]* ]+\n") ; | ||
{ fprintf (stderr, "Program: pbwt\n") ; | ||
fprintf (stderr, "Version: %d.%d%s%s (using htslib %s)\n", pbwtMajorVersion, pbwtMinorVersion, | ||
strcmp(pbwtCommitHash(),"")==0 ? "" : "-", pbwtCommitHash(), pbwtHtslibVersionString()) ; | ||
fprintf (stderr, "Contact: Richard Durbin [[email protected]]\n") ; | ||
fprintf (stderr, "Usage: pbwt [ -<command> [options]* ]+\n") ; | ||
fprintf (stderr, "Commands:\n") ; | ||
fprintf (stderr, " -check do various checks\n") ; | ||
fprintf (stderr, " -stats print stats depending on commands; writes to stdout\n") ; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters