MCPcopy Create free account
hub / github.com/git/git / optnamearg

Function optnamearg

parse-options.c:376–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376static char *optnamearg(const struct option *opt, const char *arg,
377 enum opt_parsed flags)
378{
379 if (flags & OPT_SHORT)
380 return xstrfmt("-%c%s", opt->short_name, arg ? arg : "");
381 return xstrfmt("--%s%s%s%s", flags & OPT_UNSET ? "no-" : "",
382 opt->long_name, arg ? "=" : "", arg ? arg : "");
383}
384
385static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
386 const struct option *opt,

Callers 1

get_valueFunction · 0.85

Calls 1

xstrfmtFunction · 0.85

Tested by

no test coverage detected