aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_getopt_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-15 11:14:36 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-15 11:14:59 +0100
commitf09c53eb6f8c540cc3bc3730f9e34be596ed3716 (patch)
tree524957bd395bfca32e006163d44601936bf2afda /src/include/gnunet_getopt_lib.h
parentdc0d60c9c8a635221c0d656611f8f93e0256ed84 (diff)
downloadgnunet-f09c53eb6f8c540cc3bc3730f9e34be596ed3716.tar.gz
gnunet-f09c53eb6f8c540cc3bc3730f9e34be596ed3716.zip
add way to mark options as mandatory, get tests to pass again
Diffstat (limited to 'src/include/gnunet_getopt_lib.h')
-rw-r--r--src/include/gnunet_getopt_lib.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h
index bc2e079da..c2bd72340 100644
--- a/src/include/gnunet_getopt_lib.h
+++ b/src/include/gnunet_getopt_lib.h
@@ -131,6 +131,11 @@ struct GNUNET_GETOPT_CommandLineOption
131 int require_argument; 131 int require_argument;
132 132
133 /** 133 /**
134 * Is the presence of this option mandatory?
135 */
136 int option_mandatory;
137
138 /**
134 * Handler for the option. 139 * Handler for the option.
135 */ 140 */
136 GNUNET_GETOPT_CommandLineOptionProcessor processor; 141 GNUNET_GETOPT_CommandLineOptionProcessor processor;
@@ -389,10 +394,20 @@ GNUNET_GETOPT_OPTION_CFG_FILE (char **fn);
389 394
390 395
391/** 396/**
397 * Make the given option mandatory.
398 *
399 * @param opt option to modify
400 * @return @a opt with the mandatory flag set.
401 */
402struct GNUNET_GETOPT_CommandLineOption
403GNUNET_GETOPT_OPTION_MANDATORY (struct GNUNET_GETOPT_CommandLineOption opt);
404
405
406/**
392 * Marker for the end of the list of options. 407 * Marker for the end of the list of options.
393 */ 408 */
394#define GNUNET_GETOPT_OPTION_END \ 409#define GNUNET_GETOPT_OPTION_END \
395 { '\0', NULL, NULL, NULL, 0, NULL, NULL, NULL } 410 { '\0', NULL, NULL, NULL, 0, 0, NULL, NULL, NULL }
396 411
397 412
398/** 413/**