]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hardlink: print supported feature on --version
authorKarel Zak <kzak@redhat.com>
Mon, 13 Jun 2022 10:03:26 +0000 (12:03 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Jun 2022 10:03:26 +0000 (12:03 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/hardlink.c

index b1eefb9e48783f259d2e45d383454e1daf7ec93c..0582bbc976ebc1ab16bdec9d36904a254f1b376b 100644 (file)
@@ -186,10 +186,10 @@ static struct options {
        size_t cache_size;
 } opts = {
        /* default setting */
-#ifdef __APPLE__
-       .method = "memcmp",
-#else
+#ifdef USE_FILEEQ_CRYPTOAPI
        .method = "sha256",
+#else
+       .method = "memcmp",
 #endif
        .respect_mode = TRUE,
        .respect_owner = TRUE,
@@ -1295,9 +1295,21 @@ static int parse_options(int argc, char *argv[])
                case 'h':
                        usage();
                case 'V':
-                       print_version(EXIT_SUCCESS);
+               {
+                       static const char *features[] = {
+#ifdef USE_REFLINK
+                               "reflink",
+#endif
+#ifdef USE_FILEEQ_CRYPTOAPI
+                               "cryptoapi",
+#endif
+                               NULL
+                       };
+                       print_version_with_features(EXIT_SUCCESS, features);
+               }
                default:
-                       errtryhelp(EXIT_FAILURE);}
+                       errtryhelp(EXIT_FAILURE);
+               }
        }
 
        return 0;