mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zfs get: add '-t fs' and '-t vol' options
Make `zfs get` accept `fs` for `filesystem` and `vol` for `volume`. Reviewed-by: Rob Norris <rob.norris@klarasystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan <errornointernet@envs.net> Closes #16117
This commit is contained in:
+16
-6
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user