Improve pg_archivecleanup and pg_standby --help output
authorPeter Eisentraut <[email protected]>
Thu, 5 May 2011 20:11:51 +0000 (23:11 +0300)
committerPeter Eisentraut <[email protected]>
Thu, 5 May 2011 20:19:13 +0000 (23:19 +0300)
For consistency with other tools, put the options before further usage
information.

In pg_standby, remove the supposedly deprecated -l option from the
given example invocation.

contrib/pg_archivecleanup/pg_archivecleanup.c
contrib/pg_standby/pg_standby.c

index d96eef2c5a618910bbf80ed43f3a41cac1dd82f4..dd8a45133c89c6bafc0c25f9604f2f3b297890b0 100644 (file)
@@ -203,19 +203,19 @@ usage(void)
        printf("%s removes older WAL files from PostgreSQL archives.\n\n", progname);
        printf("Usage:\n");
        printf("  %s [OPTION]... ARCHIVELOCATION OLDESTKEPTWALFILE\n", progname);
+       printf("\nOptions:\n");
+       printf("  -d                 generates debug output (verbose mode)\n");
+       printf("  --help             show this help, then exit\n");
+       printf("  --version          output version information, then exit\n");
        printf("\n"
-                  "for use as an archive_cleanup_command in the recovery.conf when standby_mode = on:\n"
+                  "For use as archive_cleanup_command in recovery.conf when standby_mode = on:\n"
                   "  archive_cleanup_command = 'pg_archivecleanup [OPTION]... ARCHIVELOCATION %%r'\n"
                   "e.g.\n"
                   "  archive_cleanup_command = 'pg_archivecleanup /mnt/server/archiverdir %%r'\n");
        printf("\n"
-                  "or for use as a standalone archive cleaner:\n"
+                  "Or for use as a standalone archive cleaner:\n"
                   "e.g.\n"
                   "  pg_archivecleanup /mnt/server/archiverdir 000000010000000000000010.00000020.backup\n");
-       printf("\nOptions:\n");
-       printf("  -d                 generates debug output (verbose mode)\n");
-       printf("  --help             show this help, then exit\n");
-       printf("  --version          output version information, then exit\n");
        printf("\nReport bugs to <[email protected]>.\n");
 }
 
index f25015fd147ef3cab3abe852bbfa4838c92f5169..4e38d9b6b27358b8725bb9e3a29a57c80d83dc64 100644 (file)
@@ -515,11 +515,6 @@ usage(void)
        printf("%s allows PostgreSQL warm standby servers to be configured.\n\n", progname);
        printf("Usage:\n");
        printf("  %s [OPTION]... ARCHIVELOCATION NEXTWALFILE XLOGFILEPATH [RESTARTWALFILE]\n", progname);
-       printf("\n"
-               "with main intended use as a restore_command in the recovery.conf:\n"
-                  "  restore_command = 'pg_standby [OPTION]... ARCHIVELOCATION %%f %%p %%r'\n"
-                  "e.g.\n"
-                  "  restore_command = 'pg_standby -l /mnt/server/archiverdir %%f %%p %%r'\n");
        printf("\nOptions:\n");
        printf("  -c                 copies file from archive (default)\n");
        printf("  -d                 generate lots of debugging output (testing only)\n");
@@ -534,6 +529,11 @@ usage(void)
        printf("  -w MAXWAITTIME     max seconds to wait for a file (0=no limit) (default=0)\n");
        printf("  --help             show this help, then exit\n");
        printf("  --version          output version information, then exit\n");
+       printf("\n"
+                  "Main intended use as restore_command in recovery.conf:\n"
+                  "  restore_command = 'pg_standby [OPTION]... ARCHIVELOCATION %%f %%p %%r'\n"
+                  "e.g.\n"
+                  "  restore_command = 'pg_standby /mnt/server/archiverdir %%f %%p %%r'\n");
        printf("\nReport bugs to <[email protected]>.\n");
 }