@@ -41,11 +41,11 @@ usage()
41
41
printf (_ ("Usage:\n" ));
42
42
printf (_ (" %s [OPTION] [DATADIR]\n" ), progname );
43
43
printf (_ ("\nOptions:\n" ));
44
- printf (_ (" [-D] DATADIR data directory\n" ));
45
- printf (_ (" -r relfilenode check only relation with specified relfilenode\n" ));
46
- printf (_ (" -d debug output, listing all checked blocks\n" ));
47
- printf (_ (" -V, --version output version information, then exit\n" ));
48
- printf (_ (" -?, --help show this help, then exit\n" ));
44
+ printf (_ (" [-D, --pgdata=] DATADIR data directory\n" ));
45
+ printf (_ (" -r relfilenode check only relation with specified relfilenode\n" ));
46
+ printf (_ (" -d debug output, listing all checked blocks\n" ));
47
+ printf (_ (" -V, --version output version information, then exit\n" ));
48
+ printf (_ (" -?, --help show this help, then exit\n" ));
49
49
printf (_ ("\nIf no data directory (DATADIR) is specified, "
50
50
"the environment variable PGDATA\nis used.\n\n" ));
51
51
printf (_ ("Report bugs to <pgsql-bugs@postgresql.org>.\n" ));
@@ -205,8 +205,14 @@ scan_directory(char *basedir, char *subdir)
205
205
int
206
206
main (int argc , char * argv [])
207
207
{
208
+ static struct option long_options [] = {
209
+ {"pgdata" , required_argument , NULL , 'D' },
210
+ {NULL , 0 , NULL , 0 }
211
+ };
212
+
208
213
char * DataDir = NULL ;
209
214
int c ;
215
+ int option_index ;
210
216
bool crc_ok ;
211
217
212
218
set_pglocale_pgservice (argv [0 ], PG_TEXTDOMAIN ("pg_verify_checksums" ));
@@ -227,7 +233,7 @@ main(int argc, char *argv[])
227
233
}
228
234
}
229
235
230
- while ((c = getopt (argc , argv , "D:r:d" )) != -1 )
236
+ while ((c = getopt_long (argc , argv , "D:r:d" , long_options , & option_index )) != -1 )
231
237
{
232
238
switch (c )
233
239
{
0 commit comments