4573 ZFS snapshot alias

illumos/illumos-gate@7dbbcd8300
This commit is contained in:
Xin LI 2014-03-28 22:44:01 +00:00
parent 5b195eb026
commit 9a7694886f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/illumos/dist/; revision=263886

View File

@ -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 '-?'
*/