Skip to content
Permalink
Browse files

4573 ZFS snapshot alias

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Dan McDonald <danmcd@omniti.com>
  • Loading branch information...
xen0l authored and Dan McDonald committed Mar 27, 2014
1 parent 709ee7c commit 7dbbcd8300f0241d3ec9686f2a0a06107c1b90cb
Showing with 10 additions and 3 deletions.
  1. +10 −3 usr/src/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 '-?'
*/

0 comments on commit 7dbbcd8

Please sign in to comment.
You can’t perform that action at this time.