pg_recvlogical: Improve --help output
authorPeter Eisentraut <peter_e@gmx.net>
Sun, 12 Oct 2014 05:45:25 +0000 (01:45 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 12 Oct 2014 05:54:25 +0000 (01:54 -0400)
List the actions first, as they are the most important options.  Group
the other options more sensibly, consistent with the man page.  Correct
a few typographical errors, clarify some things.

Also update the pg_receivexlog --help output to make it a bit more
consistent with that of pg_recvlogical.

src/bin/pg_basebackup/pg_receivexlog.c
src/bin/pg_basebackup/pg_recvlogical.c

index e6f69e4edd1aab7e78a99468fee52a277f8cc447..7374cc8eb4d5abf774da757e2e3057a8931ef993 100644 (file)
@@ -66,9 +66,12 @@ usage(void)
    printf(_("  %s [OPTION]...\n"), progname);
    printf(_("\nOptions:\n"));
    printf(_("  -D, --directory=DIR    receive transaction log files into this directory\n"));
+   printf(_("  -F  --fsync-interval=SECS\n"
+            "                         time between fsyncs to transaction log files (default: %d)\n"), (fsync_interval / 1000));
    printf(_("  -n, --no-loop          do not loop on connection lost\n"));
-   printf(_("  -F  --fsync-interval=INTERVAL\n"
-            "                         frequency of syncs to transaction log files (in seconds)\n"));
+   printf(_("  -s, --status-interval=SECS\n"
+            "                         time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
+   printf(_("  -S, --slot=SLOTNAME    replication slot to use\n"));
    printf(_("  -v, --verbose          output verbose messages\n"));
    printf(_("  -V, --version          output version information, then exit\n"));
    printf(_("  -?, --help             show this help, then exit\n"));
@@ -76,12 +79,9 @@ usage(void)
    printf(_("  -d, --dbname=CONNSTR   connection string\n"));
    printf(_("  -h, --host=HOSTNAME    database server host or socket directory\n"));
    printf(_("  -p, --port=PORT        database server port number\n"));
-   printf(_("  -s, --status-interval=INTERVAL\n"
-            "                         time between status packets sent to server (in seconds)\n"));
    printf(_("  -U, --username=NAME    connect as specified database user\n"));
    printf(_("  -w, --no-password      never prompt for password\n"));
    printf(_("  -W, --password         force password prompt (should happen automatically)\n"));
-   printf(_("  -S, --slot=SLOTNAME    replication slot to use\n"));
    printf(_("\nOptional actions:\n"));
    printf(_("      --create-slot      create a new replication slot (for the slot's name see --slot)\n"));
    printf(_("      --drop-slot        drop the replication slot (for the slot's name see --slot)\n"));
index 1a01167912306cb228000f9f8b37a79917ebc041..0d97638851dda349ce264b78abe3e89c86338146 100644 (file)
@@ -62,15 +62,27 @@ static void disconnect_and_exit(int code);
 static void
 usage(void)
 {
-   printf(_("%s receives PostgreSQL logical change stream.\n\n"),
+   printf(_("%s receives PostgreSQL logical change streams.\n\n"),
           progname);
    printf(_("Usage:\n"));
    printf(_("  %s [OPTION]...\n"), progname);
+   printf(_("\nAction to be performed:\n"));
+   printf(_("      --create-slot      create a new replication slot (for the slot's name see --slot)\n"));
+   printf(_("      --drop-slot        drop the replication slot (for the slot's name see --slot)\n"));
+   printf(_("      --start            start streaming in a replication slot (for the slot's name see --slot)\n"));
    printf(_("\nOptions:\n"));
-   printf(_("  -f, --file=FILE        receive log into this file. - for stdout\n"));
+   printf(_("  -f, --file=FILE        receive log into this file, - for stdout\n"));
    printf(_("  -F  --fsync-interval=SECS\n"
-            "                         frequency of syncs to the output file (default: %d)\n"), (fsync_interval / 1000));
+            "                         time between fsyncs to the output file (default: %d)\n"), (fsync_interval / 1000));
+   printf(_("  -I, --startpos=LSN     where in an existing slot should the streaming start\n"));
    printf(_("  -n, --no-loop          do not loop on connection lost\n"));
+   printf(_("  -o, --option=NAME[=VALUE]\n"
+            "                         pass option NAME with optional value VALUE to the\n"
+            "                         output plugin\n"));
+   printf(_("  -P, --plugin=PLUGIN    use output plugin PLUGIN (default: %s)\n"), plugin);
+   printf(_("  -s, --status-interval=SECS\n"
+            "                         time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
+   printf(_("  -S, --slot=SLOTNAME    name of the logical replication slot\n"));
    printf(_("  -v, --verbose          output verbose messages\n"));
    printf(_("  -V, --version          output version information, then exit\n"));
    printf(_("  -?, --help             show this help, then exit\n"));
@@ -81,19 +93,6 @@ usage(void)
    printf(_("  -U, --username=NAME    connect as specified database user\n"));
    printf(_("  -w, --no-password      never prompt for password\n"));
    printf(_("  -W, --password         force password prompt (should happen automatically)\n"));
-   printf(_("\nReplication options:\n"));
-   printf(_("  -I, --startpos=PTR     where in an existing slot should the streaming start\n"));
-   printf(_("  -o, --option=NAME[=VALUE]\n"
-            "                         specify option NAME with optional value VALUE, to be passed\n"
-            "                         to the output plugin\n"));
-   printf(_("  -P, --plugin=PLUGIN    use output plugin PLUGIN (default: %s)\n"), plugin);
-   printf(_("  -s, --status-interval=SECS\n"
-            "                         time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
-   printf(_("  -S, --slot=SLOT        name of the logical replication slot\n"));
-   printf(_("\nAction to be performed:\n"));
-   printf(_("      --create-slot      create a new replication slot (for the slot's name see --slot)\n"));
-   printf(_("      --drop-slot        drop the replication slot (for the slot's name see --slot)\n"));
-   printf(_("      --start            start streaming in a replication slot (for the slot's name see --slot)\n"));
    printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
 }