| 34 | } |
| 35 | |
| 36 | static void |
| 37 | argparse_error(struct argparse *self, const struct argparse_option *opt, |
| 38 | const char *reason, int flags) |
| 39 | { |
| 40 | (void)self; |
| 41 | if (flags & OPT_LONG) { |
| 42 | fprintf(stderr, "error: option `--%s` %s\n", opt->long_name, reason); |
| 43 | } else { |
| 44 | fprintf(stderr, "error: option `-%c` %s\n", opt->short_name, reason); |
| 45 | } |
| 46 | exit(EXIT_FAILURE); |
| 47 | } |
| 48 | |
| 49 | static int |
| 50 | argparse_getvalue(struct argparse *self, const struct argparse_option *opt, |