diff --git a/repmgr.c b/repmgr.c index b3b69cdc..3e41b2bf 100644 --- a/repmgr.c +++ b/repmgr.c @@ -209,6 +209,9 @@ main(int argc, char **argv) {"csv", no_argument, NULL, OPT_CSV}, {"node", required_argument, NULL, OPT_NODE}, {"version", no_argument, NULL, 'V'}, + /* Following options deprecated */ + {"local-port", required_argument, NULL, 'l'}, + {"initdb-no-pwprompt", no_argument, NULL, OPT_INITDB_NO_PWPROMPT}, {NULL, 0, NULL, 0} }; @@ -322,7 +325,7 @@ main(int argc, char **argv) /* Prevent getopt_long() from printing an error message */ opterr = 0; - while ((c = getopt_long(argc, argv, "?Vd:h:p:U:S:D:f:R:w:k:FWIvb:rcL:tm:C:", long_options, + while ((c = getopt_long(argc, argv, "?Vd:h:p:U:S:D:f:R:w:k:FWIvb:rcL:tm:C:l:", long_options, &optindex)) != -1) { /* @@ -506,6 +509,16 @@ main(int argc, char **argv) runtime_options.node = repmgr_atoi(optarg, "--node", &cli_errors, false); break; + /* deprecated options - output a warning */ + case 'l': + /* -l/--local-port is deprecated */ + item_list_append(&cli_warnings, _("-l/--local-port is deprecated; repmgr will extract the witness port from the conninfo string in repmgr.conf")); + break; + case OPT_INITDB_NO_PWPROMPT: + /* --initdb-no-pwprompt is deprecated */ + item_list_append(&cli_warnings, _("--initdb-no-pwprompt is deprecated and has no effect; use -P/--pwprompt instead")); + break; + default: unknown_option: { diff --git a/repmgr.h b/repmgr.h index e10aa86b..578dceec 100644 --- a/repmgr.h +++ b/repmgr.h @@ -56,6 +56,7 @@ #define OPT_PWPROMPT 7 #define OPT_CSV 8 #define OPT_NODE 9 +#define OPT_INITDB_NO_PWPROMPT 10 /* Run time options type */