From 7f204ac42ab70cbd105d5862c2e2348287ebddf5 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 3 Nov 2022 10:18:04 +0100 Subject: osmo-e1d: Add the usual '-V' / '--version' command line argument Change-Id: Ie2d79c44e580ffa6555f87b969206047ffb7eb6f --- src/osmo-e1d.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/osmo-e1d.c b/src/osmo-e1d.c index 281cfc7..2a07763 100644 --- a/src/osmo-e1d.c +++ b/src/osmo-e1d.c @@ -100,6 +100,7 @@ static void print_help(void) { printf(" Some useful help...\n"); printf(" -h --help This text.\n"); + printf(" -V --version Print the version of osmo-e1d.\n"); printf(" -d --debug option --debug=DE1D:DXFR enable debugging.\n"); printf(" -c --config-file filename The config file to use.\n"); } @@ -110,12 +111,13 @@ static void handle_options(int argc, char **argv) int option_index = 0, c; static const struct option long_options[] = { {"help", 0, 0, 'h'}, + {"version", 0, 0, 'V'}, {"debug", 1, 0, 'd'}, {"config-file", 1, 0, 'c'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hd:c:", long_options, &option_index); + c = getopt_long(argc, argv, "hVd:c:", long_options, &option_index); if (c == -1) break; @@ -124,6 +126,10 @@ static void handle_options(int argc, char **argv) print_help(); exit(0); break; + case 'V': + print_version(1); + exit(0); + break; case 'd': log_parse_category_mask(osmo_stderr_target, optarg); break; -- cgit v1.2.3