X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fzfs%2Fzfs_main.c;h=761c9f76a9fec578a9be85ebe1494e833daf7eea;hb=95bcd51ecc3685111e03f407fa7ce40970f99aee;hp=b88ab0986634a5991390e4f358b0719d097297e8;hpb=42cb3819f1a1f536105faac81ffc150f3da90a80;p=zfs.git diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c old mode 100755 new mode 100644 index b88ab09..761c9f7 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -229,7 +229,7 @@ get_usage(zfs_help_t idx) return (gettext("\tlist [-rH][-d max] " "[-o property[,...]] [-t type[,...]] [-s property] ...\n" "\t [-S property] ... " - "[filesystem|volume|snapshot] ...\n")); + "[filesystem|volume|snapshot|snap] ...\n")); case HELP_MOUNT: return (gettext("\tmount\n" "\tmount [-vO] [-o opts] <-a | filesystem>\n")); @@ -254,7 +254,7 @@ get_usage(zfs_help_t idx) case HELP_SHARE: return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: - return (gettext("\tsnapshot [-r] [-o property=value] ... " + return (gettext("\tsnapshot|snap [-r] [-o property=value] ... " "\n")); case HELP_UNMOUNT: return (gettext("\tunmount [-f] " @@ -2766,7 +2766,7 @@ zfs_do_list(int argc, char **argv) flags &= ~ZFS_ITER_PROP_LISTSNAPS; while (*optarg != '\0') { static char *type_subopts[] = { "filesystem", - "volume", "snapshot", "all", NULL }; + "volume", "snapshot", "snap", "all", NULL }; switch (getsubopt(&optarg, type_subopts, &value)) { @@ -2777,9 +2777,10 @@ 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_DATASET; break; @@ -6162,6 +6163,12 @@ main(int argc, char **argv) cmdname = "receive"; /* + * The 'snap' command is an alias for 'snapshot' + */ + if (strcmp(cmdname, "snap") == 0) + cmdname = "snapshot"; + + /* * Special case '-?' */ if ((strcmp(cmdname, "-?") == 0) ||