zpool/zfs: restore -V & --version options

The -j option added a round of getopt, which didn't know the magic
version flags. So just bypass the whole thing and go straight to the
human output function for the special case.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Umer Saleem <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes #16615 
Closes #16617
This commit is contained in:
Rob Norris authored and GitHub committed 2024-10-07 13:09:08 -07:00
1 parent ab777f436c
commit ca0141f325
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -9187,7 +9187,7 @@ main(int argc, char **argv)
* Special case '-V|--version'
*/
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
return (zfs_do_version(argc, argv));
return (zfs_version_print() != 0);
/*
* Special case 'help'
+1 -1
View File
@@ -13613,7 +13613,7 @@ main(int argc, char **argv)
* Special case '-V|--version'
*/
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
return (zpool_do_version(argc, argv));
return (zfs_version_print() != 0);
/*
* Special case 'help'