]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: add info about libmount features to --version output
authorKarel Zak <kzak@redhat.com>
Mon, 23 Jan 2012 11:28:05 +0000 (12:28 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Jan 2012 11:28:05 +0000 (12:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/mount.c
sys-utils/umount.c

index 634f72f844f9c043675124556719035a076e0998..280bab03517fefb1681af20d5df6c058720618d5 100644 (file)
@@ -75,11 +75,21 @@ static void __attribute__((__noreturn__)) exit_non_root(const char *option)
 static void __attribute__((__noreturn__)) print_version(void)
 {
        const char *ver = NULL;
+       const char **features = NULL, **p;
 
        mnt_get_library_version(&ver);
-
-       printf(_("%s from %s (libmount %s)\n"),
-                       program_invocation_short_name, PACKAGE_STRING, ver);
+       mnt_get_library_features(&features);
+
+       printf(_("%s from %s (libmount %s"),
+                       program_invocation_short_name,
+                       PACKAGE_STRING,
+                       ver);
+       p = features;
+       while (p && *p) {
+               fputs(p == features ? ": " : ", ", stdout);
+               fputs(*p++, stdout);
+       }
+       fputs(")\n", stdout);
        exit(MOUNT_EX_SUCCESS);
 }
 
index f19d18bdcaae39103322269756e2643c5b365416..20a2c1af7903921eb190359f9eaede130817a4b8 100644 (file)
@@ -44,17 +44,27 @@ static int table_parser_errcb(struct libmnt_table *tb __attribute__((__unused__)
        return 0;
 }
 
+
 static void __attribute__((__noreturn__)) print_version(void)
 {
        const char *ver = NULL;
+       const char **features = NULL, **p;
 
        mnt_get_library_version(&ver);
-
-       printf(_("%s from %s (libmount %s)\n"),
-                       program_invocation_short_name, PACKAGE_STRING, ver);
+       mnt_get_library_features(&features);
+
+       printf(_("%s from %s (libmount %s"),
+                       program_invocation_short_name,
+                       PACKAGE_STRING,
+                       ver);
+       p = features;
+       while (p && *p) {
+               fputs(p == features ? ": " : ", ", stdout);
+               fputs(*p++, stdout);
+       }
+       fputs(")\n", stdout);
        exit(MOUNT_EX_SUCCESS);
 }
-
 static void __attribute__((__noreturn__)) usage(FILE *out)
 {
        fputs(USAGE_HEADER, out);
@@ -66,7 +76,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 
        fputs(USAGE_OPTIONS, out);
        fprintf(out, _(
-       " -a, --all               mount all filesystems mentioned in fstab\n"
+       " -a, --all               umount all filesystems\n"
        " -c, --no-canonicalize   don't canonicalize paths\n"
        " -d, --detach-loop       if mounted loop device, also free this loop device\n"
        "     --fake              dry run; skip the umount(2) syscall\n"