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
+17 -1
View File
@@ -38,7 +38,7 @@
.Nd configures ZFS file systems
.Sh SYNOPSIS
.Nm
.Fl ?
.Fl ?V
.Nm
.Cm create
.Op Fl p
@@ -327,6 +327,8 @@
.Fl i
.Op Fl l
.Ar filesystem
.Nm
.Cm version
.Sh DESCRIPTION
The
.Nm
@@ -2453,6 +2455,13 @@ original form.
Displays a help message.
.It Xo
.Nm
.Fl V, -version
.Xc
An alias for the
.Nm zfs Cm version
subcommand.
.It Xo
.Nm
.Cm create
.Op Fl p
.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
@@ -4624,6 +4633,13 @@ Indicates that zfs should make
inherit the key of its parent. Note that this command can only be run on an
encryption root that has an encrypted parent.
.El
.It Xo
.Nm
.Cm version
.Xc
Displays the software version of the
.Nm
userland utility and the zfs kernel module.
.El
.Sh EXIT STATUS
The