blockdev: cleanup usage() and update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2007-06-29 12:06:58 +02:00
parent c2a1e78808
commit a424171cd1
2 changed files with 32 additions and 8 deletions

View File

@ -1,8 +1,9 @@
.\" -*- nroff -*-
.\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
.\" Copyright 2007 Karel Zak <kzak@redhat.com>
.\"
.\" May be distributed under the GNU General Public License
.TH BLOCKDEV 8 "May 2000" ""
.TH BLOCKDEV 8 "Jun 2007" ""
.SH NAME
blockdev \- call block device ioctls from the command line
.SH SYNOPSIS
@ -37,8 +38,19 @@ Get read-only. Print 1 if the device is read-only, 0 otherwise.
.B \--getss
Print sectorsize in bytes - usually 512.
.TP
.B \--getbsz
Print blocksize in bytes.
.TP
.BI \--setbsz " N"
Set blocksize to
.I N
bytes.
.TP
.B \--getsize
Print device capacity (in 512-byte sectors).
Print device size in sectors.
.TP
.B \--getsize64
Print device size in bytes.
.TP
.BI \--setra " N"
Set readahead to
@ -59,3 +71,9 @@ Flush buffers.
.TP
.B \--rereadpt
Reread partition table.
.SH AUTHOR
blockdev was written by Andries E. Brouwer.
.SH AVAILABILITY
blockdev is part of the util-linux-ng package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

View File

@ -108,20 +108,26 @@ struct bdc {
static void
usage(void) {
int i;
fputc('\n', stderr);
fprintf(stderr, _("Usage:\n"));
fprintf(stderr, " %s -V\n", progname);
fprintf(stderr, _(" %s --report [devices]\n"), progname);
fprintf(stderr, _(" %s [-v|-q] commands devices\n"), progname);
fputc('\n', stderr);
fprintf(stderr, _("Available commands:\n"));
fprintf(stderr, "\t--getsz\t(%s)\n", "get size in 512-byte sectors");
fprintf(stderr, "\t%-30s %s\n", "--getsz",
"get size in 512-byte sectors");
for (i = 0; i < SIZE(bdcms); i++) {
fprintf(stderr, "\t%s", bdcms[i].name);
if (bdcms[i].argname)
fprintf(stderr, " %s", bdcms[i].argname);
if (bdcms[i].help)
fprintf(stderr, "\t(%s)", _(bdcms[i].help));
fprintf(stderr, "\n");
fprintf(stderr, "\t%s %-*s %s\n", bdcms[i].name,
(int) (29 - strlen(bdcms[i].name)),
bdcms[i].argname, _(bdcms[i].help));
else
fprintf(stderr, "\t%-30s %s\n", bdcms[i].name,
_(bdcms[i].help));
}
fputc('\n', stderr);
exit(1);
}