* Provide strictly harmonized handling of --help and --version * options. */
| 19 | * options. |
| 20 | */ |
| 21 | void |
| 22 | handle_help_version_opts(int argc, char *argv[], |
| 23 | const char *fixed_progname, help_handler hlp) |
| 24 | { |
| 25 | if (argc > 1) |
| 26 | { |
| 27 | if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0) |
| 28 | { |
| 29 | hlp(get_progname(argv[0])); |
| 30 | exit(0); |
| 31 | } |
| 32 | if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0) |
| 33 | { |
| 34 | printf("%s (Apache Cloudberry) " PG_VERSION "\n", fixed_progname); |
| 35 | exit(0); |
| 36 | } |
| 37 | } |
| 38 | } |