btrfs-progs: mkfs: print version info first

The version info should not be preceded by any messages.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2015-10-30 16:58:52 +01:00
parent 4f42e465cb
commit ce059fc9d7
1 changed files with 5 additions and 7 deletions

12
mkfs.c
View File

@ -328,7 +328,6 @@ static void print_usage(int ret)
fprintf(stderr, "\t-U|--uuid UUID specify the filesystem UUID\n"); fprintf(stderr, "\t-U|--uuid UUID specify the filesystem UUID\n");
fprintf(stderr, "\t-q|--quiet no messages except errors\n"); fprintf(stderr, "\t-q|--quiet no messages except errors\n");
fprintf(stderr, "\t-V|--version print the mkfs.btrfs version and exit\n"); fprintf(stderr, "\t-V|--version print the mkfs.btrfs version and exit\n");
fprintf(stderr, "%s\n", PACKAGE_STRING);
exit(ret); exit(ret);
} }
@ -1464,6 +1463,11 @@ int main(int ac, char **av)
} }
} }
if (verbose) {
printf("%s\n", PACKAGE_STRING);
printf("See %s for more information.\n\n", PACKAGE_URL);
}
sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE)); sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
saved_optind = optind; saved_optind = optind;
dev_cnt = ac - optind; dev_cnt = ac - optind;
@ -1587,12 +1591,6 @@ int main(int ac, char **av)
if (ret) if (ret)
exit(1); exit(1);
/* if we are here that means all devs are good to btrfsify */
if (verbose) {
printf("%s\n", PACKAGE_STRING);
printf("See %s for more information.\n\n", PACKAGE_URL);
}
dev_cnt--; dev_cnt--;
if (!source_dir_set) { if (!source_dir_set) {