aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-06-15 15:46:45 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-06-15 16:34:00 +0200
commite7d29e34e4f3db0ec1a5f5b9263aec38a689a76d (patch)
tree260d314b6490bb70fe2d879eb74be6339a0a3e0e
parentd05d5e6afd50971b585fa6f243ef55a6fea9f771 (diff)
osmo-bsc: Add -V param to print version
-rw-r--r--src/osmo-bsc/osmo_bsc_main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 6967e8c11..69db32e55 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -45,6 +45,7 @@
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/ports.h>
#include <osmocom/vty/logging.h>
+#include <osmocom/vty/command.h>
#include <osmocom/abis/abis.h>
#include <osmocom/bsc/abis_om2000.h>
@@ -91,6 +92,7 @@ static void print_help()
printf(" -d --debug option --debug=DRLL:DMM:DRR:DRSL:DNM enable debugging.\n");
printf(" -s --disable-color Disable coloring log in stderr.\n");
printf(" -T --timestamp Print a timestamp in the debug output.\n");
+ printf(" -V --version Print the version of OsmoBSC.\n");
printf(" -c --config-file filename The config file to use.\n");
printf(" -l --local IP The local address of the MGCP.\n");
printf(" -e --log-level number Set a global loglevel.\n");
@@ -109,6 +111,7 @@ static void handle_options(int argc, char **argv)
{"config-file", 1, 0, 'c'},
{"disable-color", 0, 0, 's'},
{"timestamp", 0, 0, 'T'},
+ {"version", 0, 0, 'V' },
{"local", 1, 0, 'l'},
{"log-level", 1, 0, 'e'},
{"rf-ctl", 1, 0, 'r'},
@@ -116,7 +119,7 @@ static void handle_options(int argc, char **argv)
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, "hd:DsTc:e:r:t",
+ c = getopt_long(argc, argv, "hd:DsTVc:e:r:t",
long_options, &option_index);
if (c == -1)
break;
@@ -141,6 +144,10 @@ static void handle_options(int argc, char **argv)
case 'T':
log_set_print_timestamp(osmo_stderr_target, 1);
break;
+ case 'V':
+ print_version(1);
+ exit(0);
+ break;
case 'e':
log_set_log_level(osmo_stderr_target, atoi(optarg));
break;