summaryrefslogtreecommitdiffstats
path: root/mount/swapon.c
diff options
context:
space:
mode:
authorKarel Zak2007-11-26 13:07:40 +0100
committerKarel Zak2007-11-26 13:07:40 +0100
commit240e20b5a6cbfd12a9064fa451fd2075f2f41f6f (patch)
tree6c23f48707255dbbc8ce318e15326420bf9292aa /mount/swapon.c
parentbuild-sys: cleanup disk-utils/Makefile.am (use $utils_common) (diff)
downloadkernel-qcow2-util-linux-240e20b5a6cbfd12a9064fa451fd2075f2f41f6f.tar.gz
kernel-qcow2-util-linux-240e20b5a6cbfd12a9064fa451fd2075f2f41f6f.tar.xz
kernel-qcow2-util-linux-240e20b5a6cbfd12a9064fa451fd2075f2f41f6f.zip
swapon: cleanup usage output
Diffstat (limited to 'mount/swapon.c')
-rw-r--r--mount/swapon.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/mount/swapon.c b/mount/swapon.c
index ce3597e57..6c2c4866c 100644
--- a/mount/swapon.c
+++ b/mount/swapon.c
@@ -58,22 +58,38 @@ static struct option *longswapoffopts = &longswaponopts[2];
static int cannot_find(const char *special);
+#define PRINT_USAGE_SPECIAL(_fp) \
+ fprintf(_fp, _( \
+ "Special parameter:\n" \
+ " {-L label | LABEL=label} volume LABEL\n" \
+ " {-U uuid | UUID=uuid} volume UUID\n" \
+ " <file> swap file\n" \
+ " <device> swap device\n\n"))
+
static void
swapon_usage(FILE *fp, int n) {
- fprintf(fp, _("usage: %1$s [-hV]\n"
- " %1$s -a [-e] [-v]\n"
- " %1$s [-v] [-p priority] special|LABEL=volume_name ...\n"
- " %1$s [-s]\n"),
- progname);
+ fprintf(fp, _("\nUsage:\n"
+ " %1$s -a [-e] [-v] enable all swaps from /etc/fstab\n"
+ " %1$s [-v] [-p priority] <special> enable swap\n"
+ " %1$s [-s] display swap usage summary\n"
+ " %1$s [-h] display help\n"
+ " %1$s [-V] display version\n\n"), progname);
+
+ PRINT_USAGE_SPECIAL(fp);
+
exit(n);
}
static void
swapoff_usage(FILE *fp, int n) {
- fprintf(fp, _("usage: %1$s [-hV]\n"
- " %1$s -a [-v]\n"
- " %1$s [-v] special ...\n"),
- progname);
+ fprintf(fp, _("\nUsage:\n"
+ " %1$s -a [-v] disable all swaps\n"
+ " %1$s [-v] <special> disable given swap\n"
+ " %1$s [-h] display help\n"
+ " %1$s [-V] display version\n\n"), progname);
+
+ PRINT_USAGE_SPECIAL(fp);
+
exit(n);
}