| 89 | } |
| 90 | |
| 91 | static void print_sub_command_usage(const char sub_command[]) |
| 92 | { |
| 93 | fprintf(stderr, "\n"); |
| 94 | fprintf(stderr, USAGE_FMT, program_name, program_name); |
| 95 | fprintf(stderr, "\n"); |
| 96 | |
| 97 | for (int i = 0; i < sub_command_count; ++i) { |
| 98 | const struct subcommand_t *cmd = &sub_commands[i]; |
| 99 | if (!str_eq(cmd->name, sub_command)) |
| 100 | continue; |
| 101 | |
| 102 | cmd->print_help(stderr, cmd); |
| 103 | break; |
| 104 | } |
| 105 | |
| 106 | exit(EXIT_FAILURE); |
| 107 | } |
| 108 | |
| 109 | static void print_help(void) |
| 110 | { |
no test coverage detected