aboutsummaryrefslogtreecommitdiff
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,
954 954
955 if (GNUNET_YES == cont) 955 if (GNUNET_YES == cont)
956 { 956 {
957 for (count = 0; NULL != allOptions[count].name; count++) 957 for (count = 0; NULL != allOptions[count].name; count++)
958 {
959 if (allOptions[count].option_exclusive)
960 {
961 FPRINTF (stderr,
962 _("Option `%s' can't be used with other options.\n"),
963 allOptions[count].name);
964 cont = GNUNET_SYSERR;
965 }
966
958 if ( (0 == seen[count]) && 967 if ( (0 == seen[count]) &&
959 (allOptions[count].option_mandatory) ) 968 (allOptions[count].option_mandatory) )
960 { 969 {
@@ -963,6 +972,7 @@ GNUNET_GETOPT_run (const char *binaryOptions,
963 allOptions[count].name); 972 allOptions[count].name);
964 cont = GNUNET_SYSERR; 973 cont = GNUNET_SYSERR;
965 } 974 }
975 }
966 } 976 }
967 GNUNET_free (seen); 977 GNUNET_free (seen);
968 978
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)
68 .shortName = 'v', 68 .shortName = 'v',
69 .name = "version", 69 .name = "version",
70 .description = gettext_noop("print the version number"), 70 .description = gettext_noop("print the version number"),
71 .option_exclusive = 1,
71 .processor = &print_version, 72 .processor = &print_version,
72 .scls = (void *) version 73 .scls = (void *) version
73 }; 74 };