summaryrefslogtreecommitdiffstats
path: root/mount/lomount.c
diff options
context:
space:
mode:
authorKarel Zak2011-08-16 14:00:06 +0200
committerKarel Zak2011-08-16 14:00:06 +0200
commit6997468eaae62e6593a9546f6e9d66365a1fe3e7 (patch)
tree1767123b558a8ca48b64f495d93e0a816b91a7fc /mount/lomount.c
parentwrite: cleanup usage() (diff)
downloadkernel-qcow2-util-linux-6997468eaae62e6593a9546f6e9d66365a1fe3e7.tar.gz
kernel-qcow2-util-linux-6997468eaae62e6593a9546f6e9d66365a1fe3e7.tar.xz
kernel-qcow2-util-linux-6997468eaae62e6593a9546f6e9d66365a1fe3e7.zip
losetup: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/lomount.c')
-rw-r--r--mount/lomount.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/mount/lomount.c b/mount/lomount.c
index ab542e27a..757013734 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -1010,28 +1010,30 @@ find_loopdev_by_backing_file(const char *filename, char **loopdev)
#include <stdarg.h>
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 <loopdev> [<loopdev> ...] delete\n"
- " %1$s -f | --find find unused\n"
- " %1$s -c | --set-capacity <loopdev> resize\n"
- " %1$s -j | --associated <file> [-o <num>] list all associated with <file>\n"
- " %1$s [ options ] {-f|--find|loopdev} <file> setup\n"),
- progname);
-
- fprintf(f, _("\nOptions:\n"
- " -e | --encryption <type> enable data encryption with specified <name/num>\n"
- " -h | --help this help\n"
- " -o | --offset <num> start at offset <num> into file\n"
- " --sizelimit <num> loop limited to only <num> bytes of the file\n"
- " -p | --pass-fd <num> read passphrase from file descriptor <num>\n"
- " -r | --read-only setup read-only loop device\n"
- " --show print device name (with -f <file>)\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 <loopdev> [<loopdev> ...] delete\n"
+ " %1$s -f | --find find unused\n"
+ " %1$s -c | --set-capacity <loopdev> resize\n"
+ " %1$s -j | --associated <file> [-o <num>] list all associated with <file>\n"
+ " %1$s [options] {-f|--find|loopdev} <file> setup\n"),
+ progname);
+
+ fputs(_("\nOptions:\n"), out);
+ fputs(_(" -e, --encryption <type> enable data encryption with specified <name/num>\n"
+ " -h, --help this help\n"
+ " -o, --offset <num> start at offset <num> into file\n"
+ " --sizelimit <num> loop limited to only <num> bytes of the file\n"
+ " -p, --pass-fd <num> read passphrase from file descriptor <num>\n"
+ " -r, --read-only setup read-only loop device\n"
+ " --show print device name (with -f <file>)\n"
+ " -v, --verbose verbose mode\n\n"), out);
+
+ exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
int