Code

http-backend: reword some documentation
[git.git] / test-parse-options.c
index a90bc3003d97f86fcc2210e340666106647eb74c..acd1a2ba70fc2ffb38cd8fb0784aa6e5e693183f 100644 (file)
@@ -8,8 +8,9 @@ static int abbrev = 7;
 static int verbose = 0, dry_run = 0, quiet = 0;
 static char *string = NULL;
 static char *file = NULL;
+static int ambiguous;
 
-int length_callback(const struct option *opt, const char *arg, int unset)
+static int length_callback(const struct option *opt, const char *arg, int unset)
 {
        printf("Callback: \"%s\", %d\n",
                (arg ? arg : "not set"), unset);
@@ -20,7 +21,7 @@ int length_callback(const struct option *opt, const char *arg, int unset)
        return 0;
 }
 
-int number_callback(const struct option *opt, const char *arg, int unset)
+static int number_callback(const struct option *opt, const char *arg, int unset)
 {
        *(int *)opt->value = strtol(arg, NULL, 10);
        return 0;
@@ -59,6 +60,10 @@ int main(int argc, const char **argv)
                        number_callback),
                { OPTION_BOOLEAN, '+', NULL, &boolean, NULL, "same as -b",
                  PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH },
+               { OPTION_BOOLEAN, 0, "ambiguous", &ambiguous, NULL,
+                 "positive ambiguity", PARSE_OPT_NOARG | PARSE_OPT_NONEG },
+               { OPTION_BOOLEAN, 0, "no-ambiguous", &ambiguous, NULL,
+                 "negative ambiguity", PARSE_OPT_NOARG | PARSE_OPT_NONEG },
                OPT_GROUP("Standard options"),
                OPT__ABBREV(&abbrev),
                OPT__VERBOSE(&verbose),