Add command line option "repmgr --version-number"

Outputs the raw version number.

Intended for use by scripts etc.
This commit is contained in:
Ian Barwick
2019-01-08 10:04:25 +09:00
parent b89b3c0961
commit b5b9aacc8a
4 changed files with 37 additions and 1 deletions

View File

@@ -205,6 +205,7 @@ main(int argc, char **argv)
help_option = true;
break;
/* -V/--version */
case 'V':
/*
@@ -215,6 +216,11 @@ main(int argc, char **argv)
printf("%s %s\n", progname(), REPMGR_VERSION);
exit(SUCCESS);
/* --version-number */
case OPT_VERSION_NUMBER:
printf("%i\n", REPMGR_VERSION_NUM);
exit(SUCCESS);
/*------------------------------
* general configuration options
*------------------------------
@@ -2012,6 +2018,7 @@ do_help(void)
printf(_("General options:\n"));
printf(_(" -?, --help show this help, then exit\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" --version-number output version number, then exit\n"));
puts("");
printf(_("General configuration options:\n"));