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

Function usage_builtin

usage.c:45–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45static NORETURN void usage_builtin(const char *err, va_list params)
46{
47 vreportf(_("usage: "), err, params);
48
49 /*
50 * When we detect a usage error *before* the command dispatch in
51 * cmd_main(), we don't know what verb to report. Force it to this
52 * to facilitate post-processing.
53 */
54 trace2_cmd_name("_usage_");
55
56 /*
57 * Currently, the (err, params) are usually just the static usage
58 * string which isn't very useful here. Usually, the call site
59 * manually calls fprintf(stderr,...) with the actual detailed
60 * syntax error before calling usage().
61 *
62 * TODO It would be nice to update the call sites to pass both
63 * the static usage string and the detailed error message.
64 */
65
66 exit(129);
67}
68
69static void die_message_builtin(const char *err, va_list params)
70{

Callers

nothing calls this directly

Calls 1

vreportfFunction · 0.85

Tested by

no test coverage detected