From 6997468eaae62e6593a9546f6e9d66365a1fe3e7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 16 Aug 2011 14:00:06 +0200 Subject: [PATCH] losetup: cleanup usage() Signed-off-by: Karel Zak --- mount/lomount.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/mount/lomount.c b/mount/lomount.c index ab542e27ad..7570137346 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -1010,28 +1010,30 @@ find_loopdev_by_backing_file(const char *filename, char **loopdev) #include static void -usage(FILE *f) { - fprintf(f, _("\nUsage:\n" - " %1$s loop_device give info\n" - " %1$s -a | --all list all used\n" - " %1$s -d | --detach [ ...] delete\n" - " %1$s -f | --find find unused\n" - " %1$s -c | --set-capacity resize\n" - " %1$s -j | --associated [-o ] list all associated with \n" - " %1$s [ options ] {-f|--find|loopdev} setup\n"), - progname); - - fprintf(f, _("\nOptions:\n" - " -e | --encryption enable data encryption with specified \n" - " -h | --help this help\n" - " -o | --offset start at offset into file\n" - " --sizelimit loop limited to only bytes of the file\n" - " -p | --pass-fd read passphrase from file descriptor \n" - " -r | --read-only setup read-only loop device\n" - " --show print device name (with -f )\n" - " -v | --verbose verbose mode\n\n")); - - exit(f == stderr ? EXIT_FAILURE : EXIT_SUCCESS); +usage(FILE *out) { + + fputs(_("\nUsage:\n"), out); + fprintf(out, + _(" %1$s loop_device give info\n" + " %1$s -a | --all list all used\n" + " %1$s -d | --detach [ ...] delete\n" + " %1$s -f | --find find unused\n" + " %1$s -c | --set-capacity resize\n" + " %1$s -j | --associated [-o ] list all associated with \n" + " %1$s [options] {-f|--find|loopdev} setup\n"), + progname); + + fputs(_("\nOptions:\n"), out); + fputs(_(" -e, --encryption enable data encryption with specified \n" + " -h, --help this help\n" + " -o, --offset start at offset into file\n" + " --sizelimit loop limited to only bytes of the file\n" + " -p, --pass-fd read passphrase from file descriptor \n" + " -r, --read-only setup read-only loop device\n" + " --show print device name (with -f )\n" + " -v, --verbose verbose mode\n\n"), out); + + exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); } int -- 2.47.3