]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdformat: clean up usage()
authorKarel Zak <kzak@redhat.com>
Tue, 29 Jul 2014 11:53:26 +0000 (13:53 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Jul 2014 11:53:26 +0000 (13:53 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fdformat.c

index dc98de522d28bac9de580d34ca9db8ddd3117453..c6a98e10fe7098d906f40242b913c7a196274491 100644 (file)
@@ -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);