aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-06-15 15:19:21 +0200
committerHarald Welte <laforge@gnumonks.org>2018-06-20 07:38:36 +0000
commit16e7e20f8553060ece8d54ae72b33dc06a6f3e2c (patch)
treeb0131b677c871b69ceec9a5c59abea2b1cd53037 /Transceiver52M
parentc7756e73b73f9e7c64a1391f13e65f4f9d227bf4 (diff)
Add -V param to print version
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/osmo-trx.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 09ba14e..1c40fcf 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -49,6 +49,8 @@ extern "C" {
#include <osmocom/ctrl/ports.h>
#include <osmocom/ctrl/control_if.h>
#include <osmocom/vty/stats.h>
+#include <osmocom/vty/command.h>
+
#include "convolve.h"
#include "convert.h"
#include "trx_vty.h"
@@ -194,6 +196,7 @@ static void print_help()
fprintf(stdout, "Options:\n"
" -h This text\n"
" -C Filename The config file to use\n"
+ " -V Print the version of OsmoTRX\n"
);
}
@@ -211,7 +214,7 @@ static void handle_options(int argc, char **argv, struct trx_ctx* trx)
std::vector<std::string> rx_paths, tx_paths;
bool rx_paths_set = false, tx_paths_set = false;
- while ((option = getopt(argc, argv, "ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:y:z:C:")) != -1) {
+ while ((option = getopt(argc, argv, "ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:y:z:C:V")) != -1) {
switch (option) {
case 'h':
print_help();
@@ -311,6 +314,10 @@ static void handle_options(int argc, char **argv, struct trx_ctx* trx)
case 'C':
config_file = optarg;
break;
+ case 'V':
+ print_version(1);
+ exit(0);
+ break;
default:
goto bad_config;
}