From: Karel Zak Date: Tue, 29 Jul 2014 11:53:26 +0000 (+0200) Subject: fdformat: clean up usage() X-Git-Tag: v2.26-rc1~560 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80b037cc6f138a8095459afc0b7f16f586a40b57;p=thirdparty%2Futil-linux.git fdformat: clean up usage() Signed-off-by: Karel Zak --- diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c index dc98de522d..c6a98e10fe 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] \n"), program_invocation_short_name); - fprintf(out, _("\nOptions:\n" - " -f, --from start at the track N (default 0)\n" - " -t, --to stop at the track N\n" - " -r, --repair 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 start at the track N (default 0)\n"), out); + fputs(_(" -t, --to stop at the track N\n"), out); + fputs(_(" -r, --repair 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);