Add "--version" to all executables to print compile-time version info
Change-Id: I9ae504ff95beeefb9e90e02a576861351ea9e143
diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c
index 09a9e1d..82ed8c0 100644
--- a/src/bankd/bankd_main.c
+++ b/src/bankd/bankd_main.c
@@ -243,6 +243,7 @@
{
printf(
" -h --help Print this help message\n"
+" -V --version Print the version of the program\n"
" -i --server-host A.B.C.D remsim-server IP address (default: 127.0.0.1)\n"
" -p --server-port <1-65535> remsim-server TCP port (default: 9998)\n"
" -b --bank-id <1-65535> Bank Identifier of this SIM bank (default: 1)\n"
@@ -263,6 +264,7 @@
int option_index = 0, c;
static const struct option long_options[] = {
{ "help", 0, 0, 'h' },
+ { "version", 0, 0, 'V' },
{ "server-host", 1, 0, 'i' },
{ "server-port", 1, 0, 'p' },
{ "bank-id", 1, 0, 'b' },
@@ -273,7 +275,7 @@
{ 0, 0, 0, 0 }
};
- c = getopt_long(argc, argv, "hi:o:b:n:N:I:P:", long_options, &option_index);
+ c = getopt_long(argc, argv, "hVi:o:b:n:N:I:P:", long_options, &option_index);
if (c == -1)
break;
@@ -282,6 +284,10 @@
printf_help();
exit(0);
break;
+ case 'V':
+ printf("osmo-remsim-bankd version %s\n", VERSION);
+ exit(0);
+ break;
case 'i':
g_bankd->srvc.server_host = optarg;
break;