]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: use USAGE_* from mount(8) sample
authorKarel Zak <kzak@redhat.com>
Tue, 29 Nov 2011 17:06:21 +0000 (18:06 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Nov 2011 17:06:21 +0000 (18:06 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/samples/mount.c

index 6f5dbda9926fc6255ccb09745b88f0ec778a4ce7..bb7ee9e542d8238ea534b82b024892e1c9ac2cdb 100644 (file)
@@ -192,7 +192,8 @@ static int mount_all(struct libmnt_context *cxt,
 
 static void __attribute__((__noreturn__)) usage(FILE *out)
 {
-       fprintf(out, _("Usage:\n"
+       fputs(USAGE_HEADER, out);
+       fprintf(out, _(
                " %1$s [-lhV]\n"
                " %1$s -a [options]\n"
                " %1$s [options] <source> | <directory>\n"
@@ -200,8 +201,8 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
                " %1$s <operation> <mountpoint> [<target>]\n"),
                program_invocation_short_name);
 
+       fputs(USAGE_OPTIONS, out);
        fprintf(out, _(
-       "\nOptions:\n"
        " -a, --all               mount all filesystems mentioned in fstab\n"
        " -c, --no-canonicalize   don't canonicalize paths\n"
        " -f, --fake              dry run; skip the mount(2) syscall\n"
@@ -221,6 +222,10 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        " -V, --version           display version information and exit\n"
        " -w, --read-write        mount the filesystem read-write (default)\n"));
 
+       fputs(USAGE_SEPARATOR, out);
+       fputs(USAGE_HELP, out);
+       fputs(USAGE_VERSION, out);
+
        fprintf(out, _(
        "\nSource:\n"
        " -L, --label <label>     synonym for LABEL=<label>\n"
@@ -248,7 +253,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        " --make-rprivate         recursively mark a whole subtree as private\n"
        " --make-runbindable      recursively mark a whole subtree as unbindable\n"));
 
-       fprintf(out, _("\nFor more information see mount(8).\n"));
+       fprintf(out, USAGE_MAN_TAIL("mount(8)"));
 
        exit(out == stderr ? EX_USAGE : EX_SUCCESS);
 }