]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - misc-utils/blkid.c
blkid: simplify version option handling
[thirdparty/util-linux.git] / misc-utils / blkid.c
index cc29b5c6c014e7c79298ee606922e543f5778d95..eb2ea07351171c7cd3668fe867c39bd36cfe276e 100644 (file)
@@ -640,7 +640,6 @@ int main(int argc, char **argv)
        char **fltr_type = NULL;
        int fltr_flag = BLKID_FLTR_ONLYIN;
        unsigned int numdev = 0, numtag = 0;
-       int version = 0;
        int err = BLKID_EXIT_OTHER;
        unsigned int i;
        int output_format = 0;
@@ -757,8 +756,8 @@ int main(int argc, char **argv)
                        break;
                case 'V':
                case 'v':
-                       version = 1;
-                       break;
+                       print_version(stdout);
+                       goto exit;
                case 'w':
                        /* ignore - backward compatibility */
                        break;
@@ -778,11 +777,6 @@ int main(int argc, char **argv)
                        devices[numdev++] = argv[optind++];
        }
 
-       if (version) {
-               print_version(stdout);
-               goto exit;
-       }
-
        /* convert LABEL/UUID lookup to evaluate request */
        if (lookup && output_format == OUTPUT_DEVICE_ONLY && search_type &&
            (!strcmp(search_type, "LABEL") || !strcmp(search_type, "UUID"))) {