test-lib: whitelist GIT_TR2_* in the environment
[gitweb.git] / t / helper / test-parse-options.c
index f0623bb42bb1917a481c676316fe609779f84323..cc88fba05752cbf67c2669c219cc0a65d4a354ee 100644 (file)
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "parse-options.h"
 #include "string-list.h"
+#include "trace2.h"
 
 static int boolean = 0;
 static int integer = 0;
@@ -36,6 +37,7 @@ static int length_callback(const struct option *opt, const char *arg, int unset)
 
 static int number_callback(const struct option *opt, const char *arg, int unset)
 {
+       BUG_ON_OPT_NEG(unset);
        *(int *)opt->value = strtol(arg, NULL, 10);
        return 0;
 }
@@ -152,6 +154,8 @@ int cmd__parse_options(int argc, const char **argv)
        int i;
        int ret = 0;
 
+       trace2_cmd_name("_parse_");
+
        argc = parse_options(argc, (const char **)argv, prefix, options, usage, 0);
 
        if (length_cb.called) {