initdb pg_basebackup: Rename --noxxx options to --no-xxx
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 19 Oct 2016 16:00:00 +0000 (12:00 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 19 Oct 2016 12:48:48 +0000 (08:48 -0400)
--noclean and --nosync were the only options spelled without a hyphen,
so change this for consistency with other options.  The options in
pg_basebackup have not been in a release, so we just rename them.  For
initdb, we retain the old variants.

Vik Fearing and me

doc/src/sgml/ref/initdb.sgml
doc/src/sgml/ref/pg_basebackup.sgml
src/bin/initdb/initdb.c
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/test/perl/PostgresNode.pm
src/test/regress/pg_regress.c

index 4e339ecce85b36d6afcd19b095b3e5002d0480f3..31f081ae7a5f48a2ce96d30d1da43e746cd5bfc4 100644 (file)
@@ -235,7 +235,7 @@ PostgreSQL documentation
 
      <varlistentry>
       <term><option>-N</option></term>
-      <term><option>--nosync</option></term>
+      <term><option>--no-sync</option></term>
       <listitem>
        <para>
         By default, <command>initdb</command> will wait for all files to be
@@ -355,7 +355,7 @@ PostgreSQL documentation
 
      <varlistentry>
       <term><option>-n</option></term>
-      <term><option>--noclean</option></term>
+      <term><option>--no-clean</option></term>
       <listitem>
        <para>
         By default, when <command>initdb</command>
index 55e913f70de511baf6ab277b48df80e23dd7a199..7cb690dded77cb8eddc2f91db816ab61df5fa2f0 100644 (file)
@@ -400,7 +400,7 @@ PostgreSQL documentation
 
      <varlistentry>
       <term><option>-n</option></term>
-      <term><option>--noclean</option></term>
+      <term><option>--no-clean</option></term>
       <listitem>
        <para>
         By default, when <command>pg_basebackup</command> aborts with an
@@ -440,7 +440,7 @@ PostgreSQL documentation
 
      <varlistentry>
       <term><option>-N</option></term>
-      <term><option>--nosync</option></term>
+      <term><option>--no-sync</option></term>
       <listitem>
        <para>
         By default, <command>pg_basebackup</command> will wait for all files
index e52e67df614514155f54c2d8170b0e7ec7598af9..9e23f641308d1d383a7661fc8106a1ec768fbef4 100644 (file)
@@ -2402,8 +2402,8 @@ usage(const char *progname)
        printf(_("  -d, --debug               generate lots of debugging output\n"));
        printf(_("  -k, --data-checksums      use data page checksums\n"));
        printf(_("  -L DIRECTORY              where to find the input files\n"));
-       printf(_("  -n, --noclean             do not clean up after errors\n"));
-       printf(_("  -N, --nosync              do not wait for changes to be written safely to disk\n"));
+       printf(_("  -n, --no-clean            do not clean up after errors\n"));
+       printf(_("  -N, --no-sync             do not wait for changes to be written safely to disk\n"));
        printf(_("  -s, --show                show internal settings\n"));
        printf(_("  -S, --sync-only           only sync data directory\n"));
        printf(_("\nOther options:\n"));
@@ -3078,8 +3078,10 @@ main(int argc, char *argv[])
                {"version", no_argument, NULL, 'V'},
                {"debug", no_argument, NULL, 'd'},
                {"show", no_argument, NULL, 's'},
-               {"noclean", no_argument, NULL, 'n'},
-               {"nosync", no_argument, NULL, 'N'},
+               {"noclean", no_argument, NULL, 'n'}, /* for backwards compatibility */
+               {"no-clean", no_argument, NULL, 'n'},
+               {"nosync", no_argument, NULL, 'N'},  /* for backwards compatibility */
+               {"no-sync", no_argument, NULL, 'N'},
                {"sync-only", no_argument, NULL, 'S'},
                {"xlogdir", required_argument, NULL, 'X'},
                {"data-checksums", no_argument, NULL, 'k'},
@@ -3165,7 +3167,7 @@ main(int argc, char *argv[])
                                break;
                        case 'n':
                                noclean = true;
-                               printf(_("Running in noclean mode.  Mistakes will not be cleaned up.\n"));
+                               printf(_("Running in no-clean mode.  Mistakes will not be cleaned up.\n"));
                                break;
                        case 'N':
                                do_sync = false;
index 0f5d9d6a87f57358d053994a22700a0b76f4cdab..76e8f449fea0f963195b822ebc63beb4c8a7d8c5 100644 (file)
@@ -329,8 +329,8 @@ usage(void)
        printf(_("  -c, --checkpoint=fast|spread\n"
                         "                         set fast or spread checkpointing\n"));
        printf(_("  -l, --label=LABEL      set backup label\n"));
-       printf(_("  -n, --noclean          do not clean up after errors\n"));
-       printf(_("  -N, --nosync           do not wait for changes to be written safely to disk\n"));
+       printf(_("  -n, --no-clean         do not clean up after errors\n"));
+       printf(_("  -N, --no-sync          do not wait for changes to be written safely to disk\n"));
        printf(_("  -P, --progress         show progress information\n"));
        printf(_("  -v, --verbose          output verbose messages\n"));
        printf(_("  -V, --version          output version information, then exit\n"));
@@ -2006,8 +2006,8 @@ main(int argc, char **argv)
                {"gzip", no_argument, NULL, 'z'},
                {"compress", required_argument, NULL, 'Z'},
                {"label", required_argument, NULL, 'l'},
-               {"noclean", no_argument, NULL, 'n'},
-               {"nosync", no_argument, NULL, 'N'},
+               {"no-clean", no_argument, NULL, 'n'},
+               {"no-sync", no_argument, NULL, 'N'},
                {"dbname", required_argument, NULL, 'd'},
                {"host", required_argument, NULL, 'h'},
                {"port", required_argument, NULL, 'p'},
index a52bd4e124d11538fce0e553902bb3fd2db5ca49..fcedfed2b23853d573ab5cbe778124b86781e91f 100644 (file)
@@ -44,7 +44,7 @@ ok(! -d "$tempdir/backup", 'backup directory was cleaned up');
 
 $node->command_fails(
        [ 'pg_basebackup', '-D', "$tempdir/backup", '-n' ],
-       'failing run with noclean option');
+       'failing run with no-clean option');
 
 ok(-d "$tempdir/backup", 'backup directory was created and left behind');
 
index 535d6c0e7cb6cffae0d29b0109d27350272dc700..6e5a75a050b076925f966388e824eb01350d0af1 100644 (file)
@@ -484,7 +484,7 @@ sub backup
 
        print "# Taking pg_basebackup $backup_name from node \"$name\"\n";
        TestLib::system_or_bail('pg_basebackup', '-D', $backup_path, '-p', $port,
-               '-x', '--nosync');
+               '-x', '--no-sync');
        print "# Backup finished\n";
 }
 
index 762adb84432bc88df455c2929a1ef0f66db4a328..f2dedbbc8ab9eaa2ac859005b778212827a33b02 100644 (file)
@@ -2239,7 +2239,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
                /* initdb */
                header(_("initializing database system"));
                snprintf(buf, sizeof(buf),
-                                "\"%s%sinitdb\" -D \"%s/data\" --noclean --nosync%s%s > \"%s/log/initdb.log\" 2>&1",
+                                "\"%s%sinitdb\" -D \"%s/data\" --no-clean --no-sync%s%s > \"%s/log/initdb.log\" 2>&1",
                                 bindir ? bindir : "",
                                 bindir ? "/" : "",
                                 temp_instance,