mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
repmgr: emit warning if a deprecated command line option is used
This commit is contained in:
15
repmgr.c
15
repmgr.c
@@ -209,6 +209,9 @@ main(int argc, char **argv)
|
|||||||
{"csv", no_argument, NULL, OPT_CSV},
|
{"csv", no_argument, NULL, OPT_CSV},
|
||||||
{"node", required_argument, NULL, OPT_NODE},
|
{"node", required_argument, NULL, OPT_NODE},
|
||||||
{"version", no_argument, NULL, 'V'},
|
{"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}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -322,7 +325,7 @@ main(int argc, char **argv)
|
|||||||
/* Prevent getopt_long() from printing an error message */
|
/* Prevent getopt_long() from printing an error message */
|
||||||
opterr = 0;
|
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)
|
&optindex)) != -1)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -506,6 +509,16 @@ main(int argc, char **argv)
|
|||||||
runtime_options.node = repmgr_atoi(optarg, "--node", &cli_errors, false);
|
runtime_options.node = repmgr_atoi(optarg, "--node", &cli_errors, false);
|
||||||
break;
|
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:
|
default:
|
||||||
unknown_option:
|
unknown_option:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user