diff --git a/src/osmo_client_main.c b/src/osmo_client_main.c index 7ca3548..831450d 100644 --- a/src/osmo_client_main.c +++ b/src/osmo_client_main.c @@ -94,6 +94,7 @@ static void print_help() printf(" Some useful help...\n"); printf(" -h --help this text\n"); printf(" -D --daemonize Fork the process into a background daemon\n"); + printf(" -V --version Print the version number\n"); printf(" -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging\n"); printf(" -s --disable-color\n"); printf(" -T --timestamp. Print a timestamp in the debug output.\n"); @@ -138,6 +139,7 @@ static void handle_options(int argc, char **argv) {"help", 0, 0, 'h'}, {"daemonize", 0, 0, 'D'}, {"debug", 1, 0, 'd'}, + {"version", 0, 0, 'V'}, {"disable-color", 0, 0, 's'}, {"timestamp", 0, 0, 'T'}, {"log-level", 1, 0, 'e'}, @@ -166,6 +168,10 @@ static void handle_options(int argc, char **argv) case 'd': log_parse_category_mask(osmo_stderr_target, optarg); break; + case 'V': + print_version(1); + exit(0); + break; case 's': log_set_use_color(osmo_stderr_target, 0); break; diff --git a/src/osmo_server_main.c b/src/osmo_server_main.c index 9c234d5..112bd47 100644 --- a/src/osmo_server_main.c +++ b/src/osmo_server_main.c @@ -104,6 +104,7 @@ static void print_help() printf(" Some useful help...\n"); printf(" -h --help this text\n"); printf(" -D --daemonize Fork the process into a background daemon\n"); + printf(" -V --version Print the version number\n"); printf(" -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging\n"); printf(" -s --disable-color\n"); printf(" -T --timestamp. Print a timestamp in the debug output.\n"); @@ -148,6 +149,7 @@ static void handle_options(int argc, char **argv) {"help", 0, 0, 'h'}, {"daemonize", 0, 0, 'D'}, {"debug", 1, 0, 'd'}, + {"version", 0, 0, 'V'}, {"disable-color", 0, 0, 's'}, {"timestamp", 0, 0, 'T'}, {"log-level", 1, 0, 'e'}, @@ -176,6 +178,9 @@ static void handle_options(int argc, char **argv) case 'd': log_parse_category_mask(osmo_stderr_target, optarg); break; + case 'V': + print_version(1); + exit(0); case 's': log_set_use_color(osmo_stderr_target, 0); break;