mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Allow negative values in configuration parameters, where appropriate.
Make the code match the documentation. As pointed out by GitHub user phyber (#142). Also various other minor improvements to error reporting during config file parsing.
This commit is contained in:
8
repmgr.c
8
repmgr.c
@@ -263,7 +263,7 @@ main(int argc, char **argv)
|
||||
connection_param_provided = true;
|
||||
break;
|
||||
case 'p':
|
||||
repmgr_atoi(optarg, "-p/--port", &cli_errors);
|
||||
repmgr_atoi(optarg, "-p/--port", &cli_errors, false);
|
||||
strncpy(runtime_options.masterport,
|
||||
optarg,
|
||||
MAXLEN);
|
||||
@@ -281,7 +281,7 @@ main(int argc, char **argv)
|
||||
break;
|
||||
case 'l':
|
||||
/* -l/--local-port is deprecated */
|
||||
repmgr_atoi(optarg, "-l/--local-port", &cli_errors);
|
||||
repmgr_atoi(optarg, "-l/--local-port", &cli_errors, false);
|
||||
strncpy(runtime_options.localport,
|
||||
optarg,
|
||||
MAXLEN);
|
||||
@@ -293,14 +293,14 @@ main(int argc, char **argv)
|
||||
strncpy(runtime_options.remote_user, optarg, MAXLEN);
|
||||
break;
|
||||
case 'w':
|
||||
repmgr_atoi(optarg, "-w/--wal-keep-segments", &cli_errors);
|
||||
repmgr_atoi(optarg, "-w/--wal-keep-segments", &cli_errors, false);
|
||||
strncpy(runtime_options.wal_keep_segments,
|
||||
optarg,
|
||||
MAXLEN);
|
||||
wal_keep_segments_used = true;
|
||||
break;
|
||||
case 'k':
|
||||
runtime_options.keep_history = repmgr_atoi(optarg, "-k/--keep-history", &cli_errors);
|
||||
runtime_options.keep_history = repmgr_atoi(optarg, "-k/--keep-history", &cli_errors, false);
|
||||
break;
|
||||
case 'F':
|
||||
runtime_options.force = true;
|
||||
|
||||
Reference in New Issue
Block a user