aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2016-10-19 12:00:00 -0400
committerPeter Eisentraut <peter_e@gmx.net>2016-10-19 08:48:48 -0400
commit5d58c07a441414ae29a8e315d2f9868d3d8e20be (patch)
tree92b04c0ac182921e86394e66cec62aaccc48df6d /src
parentcaf936b09fc7c74844575332b07c667a178cb078 (diff)
downloadpostgresql-5d58c07a441414ae29a8e315d2f9868d3d8e20be.tar.gz
postgresql-5d58c07a441414ae29a8e315d2f9868d3d8e20be.zip
initdb pg_basebackup: Rename --noxxx options to --no-xxx
--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
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.c12
-rw-r--r--src/bin/pg_basebackup/pg_basebackup.c8
-rw-r--r--src/bin/pg_basebackup/t/010_pg_basebackup.pl2
-rw-r--r--src/test/perl/PostgresNode.pm2
-rw-r--r--src/test/regress/pg_regress.c2
5 files changed, 14 insertions, 12 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index e52e67df614..9e23f641308 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -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;
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 0f5d9d6a87f..76e8f449fea 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -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'},
diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index a52bd4e124d..fcedfed2b23 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -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');
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 535d6c0e7cb..6e5a75a050b 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -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";
}
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 762adb84432..f2dedbbc8ab 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -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,