From 9a6580a312e7ef2a02eeae6c4b176f96ea2ff4ad Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 21 Sep 2017 09:54:12 +0900 Subject: [PATCH] If problems found with configuration file, show which file was read But only if it wasn't explicitly specified with -f/--config-file. --- configfile.c | 8 +++++--- repmgr-client.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configfile.c b/configfile.c index f6a17321..0dd6f6a8 100644 --- a/configfile.c +++ b/configfile.c @@ -77,14 +77,13 @@ load_config(const char *config_file, bool verbose, bool terse, t_configuration_o { log_error(_("provided configuration file \"%s\" not found: %s"), config_file, - strerror(errno) - ); + strerror(errno)); exit(ERR_BAD_CONFIG); } if (verbose == true) { - log_notice(_("using configuration file \"%s\""), config_file); + log_notice(_("using provided configuration file \"%s\""), config_file); } config_file_provided = true; @@ -1218,6 +1217,9 @@ exit_with_config_file_errors(ItemList *config_errors, ItemList *config_warnings, item_list_free(config_warnings); } + if (config_file_provided == false) + log_detail(_("configuration file is: \"%s\""), config_file_path); + exit(ERR_BAD_CONFIG); } diff --git a/repmgr-client.c b/repmgr-client.c index 4105758c..586fbea6 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -1755,13 +1755,13 @@ do_help(void) printf(_("General options:\n")); printf(_(" -?, --help show this help, then exit\n")); printf(_(" -V, --version output version information, then exit\n")); - puts(""); printf(_("General configuration options:\n")); printf(_(" -b, --pg_bindir=PATH path to PostgreSQL binaries (optional)\n")); printf(_(" -f, --config-file=PATH path to the repmgr configuration file\n")); printf(_(" -F, --force force potentially dangerous operations to happen\n")); + puts(""); printf(_("Database connection options:\n")); printf(_(" -d, --dbname=DBNAME database to connect to (default: "));