From e7d29e34e4f3db0ec1a5f5b9263aec38a689a76d Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 15 Jun 2018 15:46:45 +0200 Subject: osmo-bsc: Add -V param to print version Change-Id: I74e0e40ee6b2ce66d76f151528d9a958683944c7 --- src/osmo-bsc/osmo_bsc_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 #include #include +#include #include #include @@ -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; -- cgit v1.2.3