comparison th_args.h @ 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 390c66af09cf
children ef71ef9b5862
comparison
equal deleted inserted replaced
586:446203207cba 587:98812eb78d8e
36 typedef struct 36 typedef struct
37 { 37 {
38 int id; ///< Option ID (should be unique for each option) 38 int id; ///< Option ID (should be unique for each option)
39 char o_short; ///< Short option name (one character, can be 0 for none) 39 char o_short; ///< Short option name (one character, can be 0 for none)
40 char *o_long; ///< Long option name (can be NULL for none) 40 char *o_long; ///< Long option name (can be NULL for none)
41 #ifdef TH_USE_OPT_ARG
42 char *o_arg; ///< Option argument name (can be NULL for none/default)
43 #endif
41 char *desc; ///< Option description 44 char *desc; ///< Option description
42 int flags; ///< Flags (see OPT_*) 45 int flags; ///< Flags (see OPT_*)
43 } th_optarg; 46 } th_optarg;
44 47
45 48