aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan <[email protected]>2024-04-23 01:59:31 +0800
committerGitHub <[email protected]>2024-04-22 10:59:31 -0700
commitc346068e5efeafd5676ab1644086877173ca4226 (patch)
tree77c7de61e9bc6e51151bb71b6442619b18a06eba
parent7e52795aad561ec39e76a3ef6fea9e5c254b2e16 (diff)
zfs get: add '-t fs' and '-t vol' options
Make `zfs get` accept `fs` for `filesystem` and `vol` for `volume`. Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan <[email protected]> Closes #16117
-rw-r--r--cmd/zfs/zfs_main.c22
-rw-r--r--man/man8/zfs-set.811
2 files changed, 26 insertions, 7 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index ec52c563b..0bbdd5b18 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -2146,15 +2146,25 @@ found2:;
for (char *tok; (tok = strsep(&optarg, ",")); ) {
static const char *const type_opts[] = {
- "filesystem", "volume",
- "snapshot", "snap",
+ "filesystem",
+ "fs",
+ "volume",
+ "vol",
+ "snapshot",
+ "snap",
"bookmark",
- "all" };
+ "all"
+ };
static const int type_types[] = {
- ZFS_TYPE_FILESYSTEM, ZFS_TYPE_VOLUME,
- ZFS_TYPE_SNAPSHOT, ZFS_TYPE_SNAPSHOT,
+ ZFS_TYPE_FILESYSTEM,
+ ZFS_TYPE_FILESYSTEM,
+ ZFS_TYPE_VOLUME,
+ ZFS_TYPE_VOLUME,
+ ZFS_TYPE_SNAPSHOT,
+ ZFS_TYPE_SNAPSHOT,
ZFS_TYPE_BOOKMARK,
- ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK };
+ ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK
+ };
for (i = 0; i < ARRAY_SIZE(type_opts); ++i)
if (strcmp(tok, type_opts[i]) == 0) {
diff --git a/man/man8/zfs-set.8 b/man/man8/zfs-set.8
index c01bcc643..8cc19caf3 100644
--- a/man/man8/zfs-set.8
+++ b/man/man8/zfs-set.8
@@ -29,7 +29,7 @@
.\" Copyright 2018 Nexenta Systems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\"
-.Dd March 16, 2022
+.Dd April 20, 2024
.Dt ZFS-SET 8
.Os
.
@@ -158,6 +158,15 @@ A comma-separated list of types to display, where
.Ar type
is one of
.Sy filesystem , snapshot , volume , bookmark , No or Sy all .
+.Sy fs ,
+.Sy snap ,
+or
+.Sy vol
+can be used as aliases for
+.Sy filesystem ,
+.Sy snapshot ,
+or
+.Sy volume .
.El
.It Xo
.Nm zfs