Skip to content

Commit

Permalink
zpool/zfs: restore -V & --version options
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robn authored Oct 7, 2024
1 parent ab777f4 commit ca0141f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ca0141f

Please sign in to comment.