Add "--version" to all executables to print compile-time version info
Change-Id: I9ae504ff95beeefb9e90e02a576861351ea9e143
diff --git a/src/simtrace2-remsim_client.c b/src/simtrace2-remsim_client.c
index e97ed9d..69d6a04 100644
--- a/src/simtrace2-remsim_client.c
+++ b/src/simtrace2-remsim_client.c
@@ -696,6 +696,7 @@
"\t-c\t--client-id <0-65535>\n"
"\t-n\t--client-slot <0-65535>\n"
"\t-h\t--help\n"
+ "\t-v\t--version\n"
"\t-i\t--gsmtap-ip\tA.B.C.D\n"
"\t-k\t--keep-running\n"
"\t-V\t--usb-vendor\tVENDOR_ID\n"
@@ -716,6 +717,7 @@
{ "client-id", 1, 0, 'c' },
{ "client-slot", 1, 0, 'n' },
{ "help", 0, 0, 'h' },
+ { "version", 0, 0, 'v' },
{ "gsmtap-ip", 1, 0, 'i' },
{ "keep-running", 0, 0, 'k' },
{ "usb-vendor", 1, 0, 'V' },
@@ -751,7 +753,7 @@
while (1) {
int option_index = 0;
- c = getopt_long(argc, argv, "s:p:c:n:hi:kV:P:C:I:S:A:H:a:", opts, &option_index);
+ c = getopt_long(argc, argv, "s:p:c:n:hvi:kV:P:C:I:S:A:H:a:", opts, &option_index);
if (c == -1)
break;
switch (c) {
@@ -771,6 +773,10 @@
print_help();
exit(0);
break;
+ case 'v':
+ printf("osmo-remsim-client version %s\n", VERSION);
+ exit(0);
+ break;
case 'i':
gsmtap_host = optarg;
break;