Add more --help output

This commit is contained in:
Ian Barwick
2017-08-16 17:49:46 +09:00
parent ae30f41de6
commit 0ac16f7630
6 changed files with 115 additions and 12 deletions

View File

@@ -421,5 +421,18 @@ do_bdr_help(void)
{ {
print_help_header(); print_help_header();
printf(_("Usage:\n"));
printf(_(" %s [OPTIONS] bdr register\n"), progname());
printf(_(" %s [OPTIONS] bdr unregister\n"), progname());
puts("");
printf(_("BDR REGISTER\n"));
puts("");
printf(_(" \"bdr register\" initialises the repmgr cluster and registers the initial bdr node.\n"));
puts("");
printf(_("BDR UNREGISTER\n"));
puts("");
printf(_(" \"bdr unregister\" unregisters an inactive BDR node.\n"));
puts("");
} }

View File

@@ -1170,25 +1170,35 @@ do_cluster_help(void)
puts(""); puts("");
printf(_(" Configuration file or database connection required.\n")); printf(_(" Configuration file or database connection required.\n"));
puts(""); puts("");
printf(_(" --csv emit output as CSV (with a subset of fields)\n")); printf(_(" --csv emit output as CSV (with a subset of fields)\n"));
puts(""); puts("");
printf(_("CLUSTER MATRIX\n")); printf(_("CLUSTER MATRIX\n"));
puts(""); puts("");
printf(_(" \"cluster show\" displays a matrix showing connectivity between nodes, seen from this node.\n")); printf(_(" \"cluster matrix\" displays a matrix showing connectivity between nodes, seen from this node.\n"));
puts(""); puts("");
printf(_(" Configuration file or database connection required.\n")); printf(_(" Configuration file or database connection required.\n"));
puts(""); puts("");
printf(_(" --csv emit output as CSV\n")); printf(_(" --csv emit output as CSV\n"));
puts(""); puts("");
printf(_("CLUSTER CROSSCHECK\n"));
puts("");
printf(_(" \"cluster crosscheck\" displays a matrix showing connectivity between nodes, seen from all nodes.\n"));
puts("");
printf(_(" Configuration file or database connection required.\n"));
puts("");
printf(_(" --csv emit output as CSV\n"));
puts("");
printf(_("CLUSTER EVENT\n")); printf(_("CLUSTER EVENT\n"));
puts(""); puts("");
printf(_(" \"cluster event\" lists recent events logged in the \"repmgr.events\" table.\n")); printf(_(" \"cluster event\" lists recent events logged in the \"repmgr.events\" table.\n"));
puts(""); puts("");
printf(_(" --limit maximum number of events to display (default: %i)\n"), CLUSTER_EVENT_LIMIT); printf(_(" --limit maximum number of events to display (default: %i)\n"), CLUSTER_EVENT_LIMIT);
printf(_(" --all display all events (overrides --limit)\n")); printf(_(" --all display all events (overrides --limit)\n"));
printf(_(" --event filter specific event\n")); printf(_(" --event filter specific event\n"));
puts(""); puts("");
} }

View File

@@ -1970,5 +1970,31 @@ do_node_help(void)
{ {
print_help_header(); print_help_header();
printf(_("Usage:\n"));
printf(_(" %s [OPTIONS] node status\n"), progname());
printf(_(" %s [OPTIONS] node check\n"), progname());
printf(_(" %s [OPTIONS] node rejoin\n"), progname());
printf(_(" %s [OPTIONS] node service\n"), progname());
puts("");
printf(_("NODE STATUS\n"));
puts("");
printf(_(" \"node status\" .\n"));
puts("");
printf(_("NODE CHECK\n"));
puts("");
printf(_(" \"node check\" .\n"));
puts("");
printf(_("NODE REJOIN\n"));
puts("");
printf(_(" \"node rejoin\" .\n"));
puts("");
printf(_("NODE SERVICE\n"));
puts("");
printf(_(" \"node service\" .\n"));
puts("");
} }

View File

@@ -497,5 +497,21 @@ do_primary_help(void)
{ {
print_help_header(); print_help_header();
printf(_("Usage:\n"));
printf(_(" %s [OPTIONS] primary register\n"), progname());
printf(_(" %s [OPTIONS] primary unregister\n"), progname());
puts("");
printf(_(" Note: \"%s repmgr master ...\" can be used as an alias\n"), progname());
puts("");
printf(_("PRIMARY REGISTER\n"));
puts("");
printf(_(" \"primary register\" initialises the repmgr cluster and registers the primary node.\n"));
puts("");
printf(_("PRIMARY UNREGISTER\n"));
puts("");
printf(_(" \"primary unregister\" unregisters an inactive primary node.\n"));
puts("");
} }

View File

@@ -4073,4 +4073,46 @@ do_standby_help(void)
print_help_header(); print_help_header();
printf(_("Usage:\n"));
printf(_(" %s [OPTIONS] standby clone\n"), progname());
printf(_(" %s [OPTIONS] standby register\n"), progname());
printf(_(" %s [OPTIONS] standby unregister\n"), progname());
printf(_(" %s [OPTIONS] standby promote\n"), progname());
printf(_(" %s [OPTIONS] standby follow\n"), progname());
printf(_(" %s [OPTIONS] standby switchover\n"), progname());
puts("");
printf(_("STANDBY CLONE\n"));
puts("");
printf(_(" \"standby clone\" clones a standby from the primary or an upstream node.\n"));
puts("");
printf(_("STANDBY REGISTER\n"));
puts("");
printf(_(" \"standby register\" registers the standby node.\n"));
puts("");
printf(_("STANDBY UNREGISTER\n"));
puts("");
printf(_(" \"standby unregister\" unregisters an inactive standby node.\n"));
puts("");
printf(_("STANDBY PROMOTE\n"));
puts("");
printf(_(" \"standby promote\" promotes a standby node to primary.\n"));
puts("");
printf(_("STANDBY FOLLOW\n"));
puts("");
printf(_(" \"standby follow\" instructs a standby node to follow a new primary.\n"));
puts("");
printf(_("STANDBY SWITCHOVER\n"));
puts("");
printf(_(" \"standby switchover\" promotes a standby node to primary, and demotes the previous primary to a standby.\n"));
puts("");
} }

View File

@@ -63,8 +63,7 @@ t_conninfo_param_list source_conninfo;
bool config_file_required = true; bool config_file_required = true;
char pg_bindir[MAXLEN] = ""; char pg_bindir[MAXLEN] = "";
char path_buf[MAXLEN] = "";
char path_buf[MAXLEN] = "";
/* /*
* if --node-id/--node-name provided, place that node's record here * if --node-id/--node-name provided, place that node's record here
@@ -177,14 +176,11 @@ main(int argc, char **argv)
case OPT_HELP: /* --help */ case OPT_HELP: /* --help */
help_option = true; help_option = true;
break; break;
//do_help();
//exit(SUCCESS);
case '?': case '?':
/* Actual help option given */ /* Actual help option given */
if (strcmp(argv[optind - 1], "-?") == 0) if (strcmp(argv[optind - 1], "-?") == 0)
{ {
do_help(); help_option = true;
exit(SUCCESS);
} }
break; break;
case 'V': case 'V':