Add option [-V|--version] to emit version string

Add the 'zfs version' and 'zpool version' subcommands to display
the version of the user space utilities and loaded zfs kernel
module.  For example:

$ zfs version
zfs-0.8.0-rc3_169_g67e0366b88
zfs-kmod-0.8.0-rc3_169_g67e0366b88

The '-V' and '--version' aliases were added to support the
common convention of using 'zfs --version` to obtain the version
information.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: TerraTech <1118433+TerraTech@users.noreply.github.com>
Closes #2501
Closes #8567
This commit is contained in:
TerraTech
2019-04-10 00:43:28 -07:00
committed by Brian Behlendorf
parent 8750edf1f7
commit 50478c6dad
6 changed files with 155 additions and 3 deletions
+7
View File
@@ -815,6 +815,13 @@ void libzfs_free_str_array(char **strs, int count);
int libzfs_envvar_is_set(char *envvar);
/*
* Utility functions for zfs version
*/
extern void zfs_version_userland(char *, int);
extern int zfs_version_kernel(char *, int);
extern int zfs_version_print(void);
/*
* Given a device or file, determine if it is part of a pool.
*/