]> git.ipfire.org Git - thirdparty/git.git/blob - builtin-bisect--helper.c
bisect--helper: add "--next-exit" to output bisect results
[thirdparty/git.git] / builtin-bisect--helper.c
1 #include "builtin.h"
2 #include "cache.h"
3 #include "parse-options.h"
4 #include "bisect.h"
5
6 static const char * const git_bisect_helper_usage[] = {
7 "git bisect--helper --next-vars",
8 "git bisect--helper --next-exit",
9 NULL
10 };
11
12 int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
13 {
14 int next_vars = 0;
15 int next_exit = 0;
16 struct option options[] = {
17 OPT_BOOLEAN(0, "next-vars", &next_vars,
18 "output next bisect step variables"),
19 OPT_BOOLEAN(0, "next-exit", &next_exit,
20 "output bisect result and exit instuctions"),
21 OPT_END()
22 };
23
24 argc = parse_options(argc, argv, options, git_bisect_helper_usage, 0);
25
26 if ((next_vars && next_exit) || (!next_vars && !next_exit))
27 usage_with_options(git_bisect_helper_usage, options);
28
29 if (next_vars)
30 return bisect_next_vars(prefix);
31 else /* next-exit */
32 return bisect_next_exit(prefix);
33 }