Change in osmo-sgsn[master]: Add --version cmdline option

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11385 )

Change subject: Add --version cmdline option
..


Patch Set 1: Code-Review+1

the commit log mesage should state to *what* it's adding the --version.  After 
all, gtphub is a rather exotic binary, and not the normal sgsn that one would 
expect in absence of any explcit mention of the binary.


--
To view, visit https://gerrit.osmocom.org/11385
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
Gerrit-Change-Number: 11385
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:28:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sgsn[master]: Add --version cmdline option

2018-10-16 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11385


Change subject: Add --version cmdline option
..

Add --version cmdline option

Related: OS#3576
Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
---
M src/gprs/gtphub_main.c
1 file changed, 7 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/85/11385/1

diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c
index a1a2c1d..f824016 100644
--- a/src/gprs/gtphub_main.c
+++ b/src/gprs/gtphub_main.c
@@ -238,6 +238,7 @@
printf("  -e,--log-level   Set a global log level.\n");
printf("  -r,--restart-file  File for counting restarts [%s].\n",
   ccfg->restart_counter_file);
+   printf("  -V,--version Print the version number.\n");
 }

 static void list_categories(void)
@@ -265,10 +266,11 @@
{"timestamp", 0, 0, 'T'},
{"log-level", 1, 0, 'e'},
{"restart-file", 1, 0, 'r'},
+   { "version", 0, 0, 'V' },
{NULL, 0, 0, 0}
};

-   c = getopt_long(argc, argv, "hd:Dc:sTe:r:",
+   c = getopt_long(argc, argv, "hd:Dc:sTe:r:V",
long_options, _index);
if (c == -1) {
if (optind < argc) {
@@ -310,6 +312,10 @@
case 'r':
ccfg->restart_counter_file = optarg;
break;
+   case 'V':
+   print_version(1);
+   exit(EXIT_SUCCESS);
+   break;
default:
LOGP(DGTPHUB, LOGL_FATAL, "Invalid command line 
argument, abort.\n");
exit(1);

--
To view, visit https://gerrit.osmocom.org/11385
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
Gerrit-Change-Number: 11385
Gerrit-PatchSet: 1
Gerrit-Owner: osmith