Add warning if --superuser option provided when it won't be used

Currently the only place this option is relevant is "standby clone".
This commit is contained in:
Ian Barwick
2020-03-23 15:23:58 +09:00
parent b691a1bd10
commit 12adb5e0d1
2 changed files with 15 additions and 1 deletions

View File

@@ -1686,6 +1686,20 @@ check_cli_parameters(const int action)
}
}
if (runtime_options.superuser[0])
{
switch (action)
{
case STANDBY_CLONE:
break;
default:
item_list_append_format(&cli_warnings,
_("--superuser ignored when executing %s"),
action_name(action));
}
}
if (runtime_options.replication_conf_only == true)
{
switch (action)
@@ -2622,7 +2636,6 @@ do_help(void)
printf(_(" -p, --port=PORT database server port (default: \"%s\")\n"), runtime_options.port);
printf(_(" -U, --username=USERNAME database user name to connect as (default: \"%s\")\n"), runtime_options.username);
printf(_(" -S, --superuser=USERNAME superuser to use, if repmgr user is not superuser\n"));
puts("");