From 9a7694886fae9e779cf1525d9d87e170600d4549 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Fri, 28 Mar 2014 22:44:01 +0000 Subject: [PATCH] 4573 ZFS snapshot alias illumos/illumos-gate@7dbbcd8300f0241d3ec9686f2a0a06107c1b90cb --- cmd/zfs/zfs_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 89f7071bf3cc..c2735b0516a0 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -3052,7 +3052,7 @@ zfs_do_list(int argc, char **argv) flags &= ~ZFS_ITER_PROP_LISTSNAPS; while (*optarg != '\0') { static char *type_subopts[] = { "filesystem", - "volume", "snapshot", "bookmark", + "volume", "snapshot", "snap", "bookmark", "all", NULL }; switch (getsubopt(&optarg, type_subopts, @@ -3064,12 +3064,13 @@ zfs_do_list(int argc, char **argv) types |= ZFS_TYPE_VOLUME; break; case 2: + case 3: types |= ZFS_TYPE_SNAPSHOT; break; - case 3: + case 4: types |= ZFS_TYPE_BOOKMARK; break; - case 4: + case 5: types = ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK; break; @@ -6774,6 +6775,12 @@ main(int argc, char **argv) if (strcmp(cmdname, "recv") == 0) cmdname = "receive"; + /* + * The 'snap' command is an alias for 'snapshot' + */ + if (strcmp(cmdname, "snap") == 0) + cmdname = "snapshot"; + /* * Special case '-?' */