[MERGED] osmo-ggsn[master]: sgsnemu: Fix gengetopt package name

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Sep 24 02:58:19 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: sgsnemu: Fix gengetopt package name
......................................................................


sgsnemu: Fix gengetopt package name

gengetopt by default picks the program name from PACKAGE (autotools),
which is osmo-ggsn and is obviously wrong in case of sgsnemu.

After this patch, "sgsnemu --help" no longer shows "osmo-ggsn" but
"sgsnemu" at the top of the help text.

Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37
---
M sgsnemu/cmdline.c
M sgsnemu/cmdline.ggo
M sgsnemu/cmdline.h
3 files changed, 5 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c
index 88210d7..d7be13a 100644
--- a/sgsnemu/cmdline.c
+++ b/sgsnemu/cmdline.c
@@ -27,8 +27,7 @@
 
 const char *gengetopt_args_info_purpose = "";
 
-const char *gengetopt_args_info_usage =
-    "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]...";
+const char *gengetopt_args_info_usage = "Usage: sgsnemu [OPTIONS]...";
 
 const char *gengetopt_args_info_versiontext = "";
 
diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo
index 0184775..4fcc64a 100644
--- a/sgsnemu/cmdline.ggo
+++ b/sgsnemu/cmdline.ggo
@@ -13,6 +13,8 @@
 # 	sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h
 # to generate cmdline.c and cmdline.h
 
+package "sgsnemu"
+
 option  "debug"        d "Run in debug mode"              flag   off
 
 option  "conf"         c "Read configuration file"        string no
diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h
index 248384e..b93fa0b 100644
--- a/sgsnemu/cmdline.h
+++ b/sgsnemu/cmdline.h
@@ -21,16 +21,12 @@
 
 #ifndef CMDLINE_PARSER_PACKAGE
 /** @brief the program name (used for printing errors) */
-#define CMDLINE_PARSER_PACKAGE PACKAGE
+#define CMDLINE_PARSER_PACKAGE "sgsnemu"
 #endif
 
 #ifndef CMDLINE_PARSER_PACKAGE_NAME
 /** @brief the complete program name (used for help and version) */
-#ifdef PACKAGE_NAME
-#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME
-#else
-#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE
-#endif
+#define CMDLINE_PARSER_PACKAGE_NAME "sgsnemu"
 #endif
 
 #ifndef CMDLINE_PARSER_VERSION

-- 
To view, visit https://gerrit.osmocom.org/4031
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list