Permalink
Browse files

Add a --version option to output just version

  • Loading branch information...
philwhineray committed Nov 15, 2015
1 parent 84a06f6 commit 0eadf3748fa881cdbf920d98e01931e15a8a8617
Showing with 19 additions and 0 deletions.
  1. +19 −0 iprange.c
View
@@ -2320,6 +2320,9 @@ static void usage(const char *me) {
" -v\n"
" be verbose on stderr\n"
"\n"
" --version\n"
" print version\n"
"\n"
" --help\n"
" -h\n"
" print this message\n"
@@ -2358,6 +2361,19 @@ static void usage(const char *me) {
exit(1);
}
/* ----------------------------------------------------------------------------
* version()
*
* print version for the user
*
*/
static void version() {
fprintf(stdout, "%s\n", VERSION);
exit(1);
}
#define MODE_COMBINE 1
#define MODE_COMPARE 2
#define MODE_COMPARE_FIRST 3
@@ -2521,6 +2537,9 @@ int main(int argc, char **argv) {
strncpy(histogram_dir, argv[++i], FILENAME_MAX);
}
*/
else if(!strcmp(argv[i], "--version")) {
version();
}
else if(!strcmp(argv[i], "--help")
|| !strcmp(argv[i], "-h")) {
usage(argv[0]);

0 comments on commit 0eadf37

Please sign in to comment.