MCPcopy Index your code
hub / github.com/git/git / get_arg

Function get_arg

parse-options.c:47–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47static enum parse_opt_result get_arg(struct parse_opt_ctx_t *p,
48 const struct option *opt,
49 enum opt_parsed flags, const char **arg)
50{
51 if (p->opt) {
52 *arg = p->opt;
53 p->opt = NULL;
54 } else if (p->argc == 1 && (opt->flags & PARSE_OPT_LASTARG_DEFAULT)) {
55 *arg = (const char *)opt->defval;
56 } else if (p->argc > 1) {
57 p->argc--;
58 *arg = *++p->argv;
59 } else
60 return error(_("%s requires a value"), optname(opt, flags));
61 return 0;
62}
63
64static char *fix_filename(const char *prefix, const char *file)
65{

Callers 1

do_get_valueFunction · 0.85

Calls 2

errorFunction · 0.85
optnameFunction · 0.85

Tested by

no test coverage detected