printf(_("Usage:\n"));
printf(_(" %s [OPTION] [DATADIR]\n"), progname);
printf(_("\nOptions:\n"));
- printf(_(" [-D] DATADIR data directory\n"));
- printf(_(" -r relfilenode check only relation with specified relfilenode\n"));
- printf(_(" -d debug output, listing all checked blocks\n"));
- printf(_(" -V, --version output version information, then exit\n"));
- printf(_(" -?, --help show this help, then exit\n"));
+ printf(_(" [-D, --pgdata=]DATADIR data directory\n"));
+ printf(_(" -r relfilenode check only relation with specified relfilenode\n"));
+ printf(_(" -d debug output, listing all checked blocks\n"));
+ printf(_(" -V, --version output version information, then exit\n"));
+ printf(_(" -?, --help show this help, then exit\n"));
printf(_("\nIf no data directory (DATADIR) is specified, "
"the environment variable PGDATA\nis used.\n\n"));
printf(_("Report bugs to
.\n"));
int
main(int argc, char *argv[])
{
+ static struct option long_options[] = {
+ {"pgdata", required_argument, NULL, 'D'},
+ {NULL, 0, NULL, 0}
+ };
+
char *DataDir = NULL;
int c;
+ int option_index;
bool crc_ok;
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_verify_checksums"));
}
}
- while ((c = getopt(argc, argv, "D:r:d")) != -1)
+ while ((c = getopt_long(argc, argv, "D:r:d", long_options, &option_index)) != -1)
{
switch (c)
{