mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
zfs list: add '-t fs' and '-t vol' options
Because "filesystem" and "volume" are just too long! Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #15864
This commit is contained in:
parent
cbe882298e
commit
a5a725440b
@ -3672,15 +3672,25 @@ zfs_do_list(int argc, char **argv)
|
|||||||
|
|
||||||
for (char *tok; (tok = strsep(&optarg, ",")); ) {
|
for (char *tok; (tok = strsep(&optarg, ",")); ) {
|
||||||
static const char *const type_subopts[] = {
|
static const char *const type_subopts[] = {
|
||||||
"filesystem", "volume",
|
"filesystem",
|
||||||
"snapshot", "snap",
|
"fs",
|
||||||
|
"volume",
|
||||||
|
"vol",
|
||||||
|
"snapshot",
|
||||||
|
"snap",
|
||||||
"bookmark",
|
"bookmark",
|
||||||
"all" };
|
"all"
|
||||||
|
};
|
||||||
static const int type_types[] = {
|
static const int type_types[] = {
|
||||||
ZFS_TYPE_FILESYSTEM, ZFS_TYPE_VOLUME,
|
ZFS_TYPE_FILESYSTEM,
|
||||||
ZFS_TYPE_SNAPSHOT, ZFS_TYPE_SNAPSHOT,
|
ZFS_TYPE_FILESYSTEM,
|
||||||
|
ZFS_TYPE_VOLUME,
|
||||||
|
ZFS_TYPE_VOLUME,
|
||||||
|
ZFS_TYPE_SNAPSHOT,
|
||||||
|
ZFS_TYPE_SNAPSHOT,
|
||||||
ZFS_TYPE_BOOKMARK,
|
ZFS_TYPE_BOOKMARK,
|
||||||
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK };
|
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK
|
||||||
|
};
|
||||||
|
|
||||||
for (c = 0; c < ARRAY_SIZE(type_subopts); ++c)
|
for (c = 0; c < ARRAY_SIZE(type_subopts); ++c)
|
||||||
if (strcmp(tok, type_subopts[c]) == 0) {
|
if (strcmp(tok, type_subopts[c]) == 0) {
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
.\" Copyright 2018 Nexenta Systems, Inc.
|
.\" Copyright 2018 Nexenta Systems, Inc.
|
||||||
.\" Copyright 2019 Joyent, Inc.
|
.\" Copyright 2019 Joyent, Inc.
|
||||||
.\"
|
.\"
|
||||||
.Dd March 16, 2022
|
.Dd February 8, 2024
|
||||||
.Dt ZFS-LIST 8
|
.Dt ZFS-LIST 8
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
@ -155,6 +155,15 @@ or
|
|||||||
For example, specifying
|
For example, specifying
|
||||||
.Fl t Sy snapshot
|
.Fl t Sy snapshot
|
||||||
displays only snapshots.
|
displays only snapshots.
|
||||||
|
.Sy fs ,
|
||||||
|
.Sy snap ,
|
||||||
|
or
|
||||||
|
.Sy vol
|
||||||
|
can be used as aliases for
|
||||||
|
.Sy filesystem ,
|
||||||
|
.Sy snapshot ,
|
||||||
|
or
|
||||||
|
.Sy volume .
|
||||||
.El
|
.El
|
||||||
.
|
.
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
|
Loading…
Reference in New Issue
Block a user