summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdformat.c
diff options
context:
space:
mode:
authorKarel Zak2014-07-29 13:53:26 +0200
committerKarel Zak2014-07-29 13:53:26 +0200
commit80b037cc6f138a8095459afc0b7f16f586a40b57 (patch)
tree692821429c9ac7fe2dd82223f3ccefaecd30632f /disk-utils/fdformat.c
parentfdformat: Add new switches -f/--from, -t/--to, -r/--repair (diff)
downloadkernel-qcow2-util-linux-80b037cc6f138a8095459afc0b7f16f586a40b57.tar.gz
kernel-qcow2-util-linux-80b037cc6f138a8095459afc0b7f16f586a40b57.tar.xz
kernel-qcow2-util-linux-80b037cc6f138a8095459afc0b7f16f586a40b57.zip
fdformat: clean up usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdformat.c')
-rw-r--r--disk-utils/fdformat.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c
index dc98de522..c6a98e10f 100644
--- a/disk-utils/fdformat.c
+++ b/disk-utils/fdformat.c
@@ -139,17 +139,21 @@ static void verify_disk(int ctrl, unsigned int track_from, unsigned int track_to
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
- fprintf(out, _("Usage: %s [options] device\n"),
+ fputs(USAGE_HEADER, out);
+ fprintf(out, _(" %s [options] <device>\n"),
program_invocation_short_name);
- fprintf(out, _("\nOptions:\n"
- " -f, --from <N> start at the track N (default 0)\n"
- " -t, --to <N> stop at the track N\n"
- " -r, --repair <N> try to repair tracks failed during\n"
- " the verification (max N retries)\n"
- " -n, --no-verify disable the verification after the format\n"
- " -V, --version output version information and exit\n"
- " -h, --help display this help and exit\n\n"));
+ fputs(USAGE_OPTIONS, out);
+ fputs(_(" -f, --from <N> start at the track N (default 0)\n"), out);
+ fputs(_(" -t, --to <N> stop at the track N\n"), out);
+ fputs(_(" -r, --repair <N> try to repair tracks failed during\n"
+ " the verification (max N retries)\n"), out);
+ fputs(_(" -n, --no-verify disable the verification after the format\n"), out);
+
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
+ fprintf(out, USAGE_MAN_TAIL("fdformat(8)"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
@@ -175,7 +179,6 @@ int main(int argc, char **argv)
{NULL, 0, NULL, 0}
};
-
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);