From 37bdad290c90e737aa992146e8354355b6c28131 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 20 Oct 2017 16:44:44 +0900 Subject: [PATCH] Add --help output for "repmgr node service" Addresses GitHub #329. --- repmgr-action-node.c | 29 ++++++++++++++--------------- repmgr-client.c | 4 ---- repmgr-client.h | 30 ++++++++++++++---------------- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/repmgr-action-node.c b/repmgr-action-node.c index 7e5f9e38..83596212 100644 --- a/repmgr-action-node.c +++ b/repmgr-action-node.c @@ -36,7 +36,6 @@ static bool copy_file(const char *src_file, const char *dest_file); static void format_archive_dir(PQExpBufferData *archive_dir); static t_server_action parse_server_action(const char *action); -static void _do_node_service_check(void); static void _do_node_service_list_actions(t_server_action action); static void _do_node_status_is_shutdown_cleanly(void); static void _do_node_archive_config(void); @@ -1402,14 +1401,6 @@ do_node_service(void) exit(ERR_BAD_CONFIG); } - if (runtime_options.check == true) - { - if (action != ACTION_NONE) - log_warning(_("--action not required for --check")); - - return _do_node_service_check(); - } - if (runtime_options.list_actions == true) { return _do_node_service_list_actions(action); @@ -1479,12 +1470,6 @@ do_node_service(void) } -static void -_do_node_service_check(void) -{ -} - - static void _do_node_service_list_actions(t_server_action action) { @@ -2259,4 +2244,18 @@ do_node_help(void) " (default: /tmp)\n")); puts(""); + printf(_("NODE SERVICE\n")); + puts(""); + printf(_(" \"node service\" executes a system service command to stop/start/restart/reload a node\n" \ + " or optionally display which command would be executed\n")); + puts(""); + printf(_(" Configuration file required, runs on local node only.\n")); + puts(""); + printf(_(" --dry-run show what action would be performed, but don't execute it\n")); + printf(_(" --action action to perform (one of \"start\", \"stop\", \"restart\" or \"reload\")\n")); + printf(_(" --list-actions show what command would be performed for each action\n")); + puts(""); + + + } diff --git a/repmgr-client.c b/repmgr-client.c index d4d378a6..171ca423 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -473,10 +473,6 @@ main(int argc, char **argv) runtime_options.list_actions = true; break; - case OPT_CHECK: - runtime_options.check = true; - break; - case OPT_CHECKPOINT: runtime_options.checkpoint = true; break; diff --git a/repmgr-client.h b/repmgr-client.h index 9f09cb24..c63a92ad 100644 --- a/repmgr-client.h +++ b/repmgr-client.h @@ -66,21 +66,20 @@ #define OPT_UPSTREAM_NODE_ID 1018 #define OPT_ACTION 1019 #define OPT_LIST_ACTIONS 1020 -#define OPT_CHECK 1021 -#define OPT_CHECKPOINT 1022 -#define OPT_IS_SHUTDOWN_CLEANLY 1023 -#define OPT_ALWAYS_PROMOTE 1024 -#define OPT_FORCE_REWIND 1025 -#define OPT_NAGIOS 1026 -#define OPT_ARCHIVE_READY 1027 -#define OPT_OPTFORMAT 1028 -#define OPT_REPLICATION_LAG 1029 -#define OPT_CONFIG_FILES 1030 -#define OPT_SIBLINGS_FOLLOW 1031 -#define OPT_ROLE 1032 -#define OPT_DOWNSTREAM 1033 -#define OPT_SLOTS 1034 -#define OPT_CONFIG_ARCHIVE_DIR 1035 +#define OPT_CHECKPOINT 1021 +#define OPT_IS_SHUTDOWN_CLEANLY 1022 +#define OPT_ALWAYS_PROMOTE 1023 +#define OPT_FORCE_REWIND 1024 +#define OPT_NAGIOS 1025 +#define OPT_ARCHIVE_READY 1026 +#define OPT_OPTFORMAT 1027 +#define OPT_REPLICATION_LAG 1028 +#define OPT_CONFIG_FILES 1029 +#define OPT_SIBLINGS_FOLLOW 1030 +#define OPT_ROLE 1031 +#define OPT_DOWNSTREAM 1032 +#define OPT_SLOTS 1033 +#define OPT_CONFIG_ARCHIVE_DIR 1034 /* deprecated since 3.3 */ #define OPT_DATA_DIR 999 #define OPT_NO_CONNINFO_PASSWORD 998 @@ -161,7 +160,6 @@ static struct option long_options[] = /* "node service" options */ {"action", required_argument, NULL, OPT_ACTION}, - {"check", no_argument, NULL, OPT_CHECK}, {"list-actions", no_argument, NULL, OPT_LIST_ACTIONS}, {"checkpoint", no_argument, NULL, OPT_CHECKPOINT},