From: Karel Zak Date: Mon, 23 Jan 2012 11:28:05 +0000 (+0100) Subject: mount: add info about libmount features to --version output X-Git-Tag: v2.21-rc2~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac8ecab4bec840a381b1e901e905ca78f7c3e453;p=thirdparty%2Futil-linux.git mount: add info about libmount features to --version output Signed-off-by: Karel Zak --- diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 634f72f844..280bab0351 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -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); } diff --git a/sys-utils/umount.c b/sys-utils/umount.c index f19d18bdca..20a2c1af79 100644 --- a/sys-utils/umount.c +++ b/sys-utils/umount.c @@ -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"