|
|
|
@ -237,14 +237,25 @@ main(int argc, char *argv[]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (DataDir == NULL && optind == argc) |
|
|
|
|
if (DataDir == NULL && optind < argc) |
|
|
|
|
DataDir = argv[optind++]; |
|
|
|
|
|
|
|
|
|
/* Complain if any arguments remain */ |
|
|
|
|
if (optind < argc) |
|
|
|
|
{ |
|
|
|
|
fprintf(stderr, _("%s: too many command-line arguments (first is \"%s\")\n"), |
|
|
|
|
progname, argv[optind]); |
|
|
|
|
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), |
|
|
|
|
progname); |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (DataDir == NULL) |
|
|
|
|
{ |
|
|
|
|
fprintf(stderr, _("%s: no data directory specified\n"), progname); |
|
|
|
|
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname); |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
if (DataDir == NULL) |
|
|
|
|
DataDir = argv[optind]; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Don't allow pg_resetxlog to be run as root, to avoid overwriting the |
|
|
|
|