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

Function parseopt_dump

builtin/rev-parse.c:395–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395static int parseopt_dump(const struct option *o, const char *arg, int unset)
396{
397 struct strbuf *parsed = o->value;
398 if (unset)
399 strbuf_addf(parsed, " --no-%s", o->long_name);
400 else if (o->short_name && (o->long_name == NULL || !stuck_long))
401 strbuf_addf(parsed, " -%c", o->short_name);
402 else
403 strbuf_addf(parsed, " --%s", o->long_name);
404 if (arg) {
405 if (!stuck_long)
406 strbuf_addch(parsed, ' ');
407 else if (o->long_name)
408 strbuf_addch(parsed, '=');
409 sq_quote_buf(parsed, arg);
410 }
411 return 0;
412}
413
414static const char *skipspaces(const char *s)
415{

Callers

nothing calls this directly

Calls 3

strbuf_addfFunction · 0.85
strbuf_addchFunction · 0.85
sq_quote_bufFunction · 0.85

Tested by

no test coverage detected