]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (libmount) parse version from command line
authorKarel Zak <kzak@redhat.com>
Wed, 17 May 2017 09:28:19 +0000 (11:28 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 17 May 2017 09:28:19 +0000 (11:28 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/version.c

index 76e137f321ec9b75dd937e3557b1e8f74053aa21..acacf09c5d0718edd1a99a45100d7773bd289ae6 100644 (file)
@@ -110,6 +110,10 @@ static int test_version(struct libmnt_test *ts, int argc, char *argv[])
        const char *ver;
        const char **features;
 
+       if (argc == 2)
+               printf("Your version: %d\n",
+                               mnt_parse_version_string(argv[1]));
+
        mnt_get_library_version(&ver);
 
        printf("Library version: %s\n", ver);
@@ -120,6 +124,8 @@ static int test_version(struct libmnt_test *ts, int argc, char *argv[])
        while (features && *features)
                printf(" %s", *features++);
 
+       printf("\n");
+
        if (mnt_get_library_version(NULL) ==
                        mnt_parse_version_string(LIBMOUNT_VERSION))
                return 0;