laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/30000 )
Change subject: osmo-e1d: Add the usual '-V' / '--version' command line argument ......................................................................
osmo-e1d: Add the usual '-V' / '--version' command line argument
Change-Id: Ie2d79c44e580ffa6555f87b969206047ffb7eb6f --- M src/osmo-e1d.c 1 file changed, 7 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved
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 @@ { 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 @@ 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 @@ print_help(); exit(0); break; + case 'V': + print_version(1); + exit(0); + break; case 'd': log_parse_category_mask(osmo_stderr_target, optarg); break;