| 24 | } |
| 25 | |
| 26 | static void |
| 27 | argparse_error(struct argparse *this_, const struct argparse_option *opt, |
| 28 | const char *reason) |
| 29 | { |
| 30 | if (!strncmp(this_->argv[0], "--", 2)) { |
| 31 | fprintf(stderr, "error: option `%s` %s\n", opt->long_name, reason); |
| 32 | exit(-1); |
| 33 | } else { |
| 34 | fprintf(stderr, "error: option `%c` %s\n", opt->short_name, reason); |
| 35 | exit(-1); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | static int |
| 40 | argparse_getvalue(struct argparse *this_, const struct argparse_option *opt, |