diff th_args.c @ 587:98812eb78d8e

Add new compile-time optional th_optarg struct field o_arg for specifying the option argument description/name. TH_USE_OPT_ARG must be defined at compile time.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 12 Jan 2020 18:03:47 +0200
parents 446203207cba
children ef71ef9b5862
line wrap: on
line diff
--- a/th_args.c	Sun Jan 12 18:01:47 2020 +0200
+++ b/th_args.c	Sun Jan 12 18:03:47 2020 +0200
@@ -247,8 +247,12 @@
 
 static inline const char *th_args_get_optarg(const th_optarg *opt)
 {
+#ifdef TH_USE_OPT_ARG
+    return opt->o_arg != NULL ? opt->o_arg : "ARG";
+#else
     (void) opt;
     return "ARG";
+#endif
 }