| 43 | } |
| 44 | |
| 45 | static 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 | |
| 69 | static void die_message_builtin(const char *err, va_list params) |
| 70 | { |
nothing calls this directly
no test coverage detected