aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-11-03 10:18:04 +0100
committerHarald Welte <laforge@osmocom.org>2022-11-03 10:18:54 +0100
commit7f204ac42ab70cbd105d5862c2e2348287ebddf5 (patch)
treed9e1534044130c1dd17b881a7cc0cd88aa603def /src
parent81546e67730af9bf80b1410e80c250dd6a9ce9f7 (diff)
osmo-e1d: Add the usual '-V' / '--version' command line argument
Diffstat (limited to 'src')
-rw-r--r--src/osmo-e1d.c8
1 files changed, 7 insertions, 1 deletions
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;