summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/getopt.c12
-rw-r--r--src/util/getopt_helpers.c1
2 files changed, 12 insertions, 1 deletions
diff --git a/src/util/getopt.c b/src/util/getopt.c
index 5e8571ee5..44f6dcda2 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -954,7 +954,16 @@ GNUNET_GETOPT_run (const char *binaryOptions,
if (GNUNET_YES == cont)
{
- for (count = 0; NULL != allOptions[count].name; count++)
+ for (count = 0; NULL != allOptions[count].name; count++)
+ {
+ if (allOptions[count].option_exclusive)
+ {
+ FPRINTF (stderr,
+ _("Option `%s' can't be used with other options.\n"),
+ allOptions[count].name);
+ cont = GNUNET_SYSERR;
+ }
+
if ( (0 == seen[count]) &&
(allOptions[count].option_mandatory) )
{
@@ -963,6 +972,7 @@ GNUNET_GETOPT_run (const char *binaryOptions,
allOptions[count].name);
cont = GNUNET_SYSERR;
}
+ }
}
GNUNET_free (seen);
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index 77032e501..d6ba85733 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -68,6 +68,7 @@ GNUNET_GETOPT_option_version (const char *version)
.shortName = 'v',
.name = "version",
.description = gettext_noop("print the version number"),
+ .option_exclusive = 1,
.processor = &print_version,
.scls = (void *) version
};