aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-09-24 10:53:53 +0800
committerHarald Welte <laforge@gnumonks.org>2017-09-24 10:55:26 +0800
commit6045efb642918ac43056ca6a40cda2fe2e6db08d (patch)
treea65183ff1273f9c8aae903443d0ac821051548bb
parent078bc097fca2f3482da8fd2c25d84d9275eaabab (diff)
sgsnemu: Fix gengetopt package name
gengetopt by default picks the program name from PACKAGE (autotools), which is openggsn and is obviously wrong in case of sgsnemu. After this patch, "sgsnemu --help" no longer shows "openggsn" but "sgsnemu" at the top of the help text. Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37
-rw-r--r--sgsnemu/cmdline.c3
-rw-r--r--sgsnemu/cmdline.ggo2
-rw-r--r--sgsnemu/cmdline.h8
3 files changed, 5 insertions, 8 deletions
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 540cd8e..4196d80 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 @@ extern "C" {
#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