Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita846e6d

Browse files
committed
pg_verify_checksums: rename -d to --verbose
Using -d is odd, because we normally reserve that for a databaseargument, so rename it to -v and add long version --verbose.Also, reduce it to emit one line per file checked rather than one lineper block.Per a complaint from Michael Banck.Author: Yugo Nagata <nagata@sraoss.co.jp>Reviewed-by: Michael Banck <michael.banck@credativ.de>Discussion:https://postgr.es/m/20180827113411.GA22768@nighthawk.caipicrew.dd-dns.de
1 parent4db226b commita846e6d

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

‎doc/src/sgml/ref/pg_verify_checksums.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ PostgreSQL documentation
6161
</varlistentry>
6262

6363
<varlistentry>
64-
<term><option>-d</option></term>
64+
<term><option>-v</option></term>
65+
<term><option>--verbose</option></term>
6566
<listitem>
6667
<para>
67-
Enabledebug output. Lists all checkedblocks and their checksum.
68+
Enableverbose output. Lists all checkedfiles.
6869
</para>
6970
</listitem>
7071
</varlistentry>

‎src/bin/pg_verify_checksums/pg_verify_checksums.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static int64 badblocks = 0;
3131
staticControlFileData*ControlFile;
3232

3333
staticchar*only_relfilenode=NULL;
34-
staticbooldebug= false;
34+
staticboolverbose= false;
3535

3636
staticconstchar*progname;
3737

@@ -43,7 +43,7 @@ usage()
4343
printf(_(" %s [OPTION]... [DATADIR]\n"),progname);
4444
printf(_("\nOptions:\n"));
4545
printf(_(" [-D, --pgdata=]DATADIR data directory\n"));
46-
printf(_(" -d debugoutput, list all checked blocks\n"));
46+
printf(_(" -v, --verbose output verbose messages\n"));
4747
printf(_(" -r RELFILENODE check only relation with specified relfilenode\n"));
4848
printf(_(" -V, --version output version information, then exit\n"));
4949
printf(_(" -?, --help show this help, then exit\n"));
@@ -120,11 +120,12 @@ scan_file(char *fn, int segmentno)
120120
progname,fn,blockno,csum,header->pd_checksum);
121121
badblocks++;
122122
}
123-
elseif (debug)
124-
fprintf(stderr,_("%s: checksum verified in file \"%s\", block %d: %X\n"),
125-
progname,fn,blockno,csum);
126123
}
127124

125+
if (verbose)
126+
fprintf(stderr,
127+
_("%s: checksums verified in file \"%s\"\n"),progname,fn);
128+
128129
close(f);
129130
}
130131

@@ -208,6 +209,7 @@ main(int argc, char *argv[])
208209
{
209210
staticstructoptionlong_options[]= {
210211
{"pgdata",required_argument,NULL,'D'},
212+
{"verbose",no_argument,NULL,'v'},
211213
{NULL,0,NULL,0}
212214
};
213215

@@ -234,12 +236,12 @@ main(int argc, char *argv[])
234236
}
235237
}
236238

237-
while ((c=getopt_long(argc,argv,"D:r:d",long_options,&option_index))!=-1)
239+
while ((c=getopt_long(argc,argv,"D:r:v",long_options,&option_index))!=-1)
238240
{
239241
switch (c)
240242
{
241-
case'd':
242-
debug= true;
243+
case'v':
244+
verbose= true;
243245
break;
244246
case'D':
245247
DataDir=optarg;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp