Commit ee075fcb authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix reporting of missing or invalid command line arguments in pg_rewind.

pg_fatal never returns, so a multi-line message cannot be printed by
calling it twice.

Michael Paquier and Fujii Masao
parent 4e17e32f
......@@ -157,21 +157,21 @@ main(int argc, char **argv)
/* No source given? Show usage */
if (datadir_source == NULL && connstr_source == NULL)
{
pg_fatal("no source specified (--source-pgdata or --source-server)\n");
pg_fatal("Try \"%s --help\" for more information.\n", progname);
fprintf(stderr, _("no source specified (--source-pgdata or --source-server)\n"));
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
if (datadir_target == NULL)
{
pg_fatal("no target data directory specified (--target-pgdata)\n");
fprintf(stderr, _("no target data directory specified (--target-pgdata)\n"));
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
if (argc != optind)
{
pg_fatal("%s: invalid arguments\n", progname);
fprintf(stderr, _("invalid arguments\n"));
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment