]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - misc-utils/wipefs.c
misc: consolidate version printing and close_stdout()
[thirdparty/util-linux.git] / misc-utils / wipefs.c
index 13a720e85fbce8fa04878e8636bc4ba926002fb8..78e5ac376ecb5da63daca41834b6ab3d7c6cc170 100644 (file)
@@ -700,7 +700,7 @@ main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
-       atexit(close_stdout);
+       close_stdout_atexit();
 
        while ((c = getopt_long(argc, argv, "abfhiJnO:o:pqt:V", longopts, NULL)) != -1) {
 
@@ -716,9 +716,6 @@ main(int argc, char **argv)
                case 'f':
                        ctl.force = 1;
                        break;
-               case 'h':
-                       usage();
-                       break;
                case 'J':
                        ctl.json = 1;
                        break;
@@ -745,9 +742,11 @@ main(int argc, char **argv)
                case 't':
                        ctl.type_pattern = optarg;
                        break;
+
+               case 'h':
+                       usage();
                case 'V':
-                       printf(UTIL_LINUX_VERSION);
-                       return EXIT_SUCCESS;
+                       print_version(EXIT_SUCCESS);
                default:
                        errtryhelp(EXIT_FAILURE);
                }