diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-15 16:45:35 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-15 16:45:35 +0200 |
commit | 4c54c97ff608559e7ba165a2983cc6b9c1da3586 (patch) | |
tree | f2f692796984192a4eb85e6825ae74a751c43b84 /openbsc/src/osmo-bsc_nat/bsc_nat.c | |
parent | 124b3f589d24522b233ab6e2eb71df74b93e78c8 (diff) |
bsc-nat: Add -V param to print version
Change-Id: I4dbf97905749aa9379bc6b6b448953d8b1825545
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat.c')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index a9f1c0b6f..ba7f5425e 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1465,6 +1465,7 @@ static void print_help() printf(" -D --daemonize Fork the process into a background daemon\n"); printf(" -s --disable-color\n"); printf(" -T --timestamp. Print a timestamp in the debug output.\n"); + printf(" -V --version. Print the version of OsmoBSCNAT.\n"); printf(" -c --config-file filename The config file to use.\n"); printf(" -m --msc=IP. The address of the MSC.\n"); printf(" -l --local=IP. The local address of this BSC.\n"); @@ -1481,12 +1482,13 @@ 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' }, {"msc", 1, 0, 'm'}, {"local", 1, 0, 'l'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hd:sTPc:m:l:D", + c = getopt_long(argc, argv, "hd:sTVPc:m:l:D", long_options, &option_index); if (c == -1) break; @@ -1511,6 +1513,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 'm': msc_ip = optarg; break; |