diff options
author | xrs <xrs@mail36.net> | 2019-06-22 22:57:55 +0200 |
---|---|---|
committer | xrs <xrs@mail36.net> | 2019-06-22 22:57:55 +0200 |
commit | d6c25f60406596d84900aa6ac012bf8ce111d57c (patch) | |
tree | 7418c56cf25b7e0fc4e84c714f76deddf15f75f6 /src/util/getopt.c | |
parent | 93c332be89c4c65f10b7c4c49b6ed15d91b91884 (diff) | |
download | gnunet-d6c25f60406596d84900aa6ac012bf8ce111d57c.tar.gz gnunet-d6c25f60406596d84900aa6ac012bf8ce111d57c.zip |
add flag for exlusive options as program agruments
Diffstat (limited to 'src/util/getopt.c')
-rw-r--r-- | src/util/getopt.c | 12 |
1 files changed, 11 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 | ||