From cf81b00a73fe47fdb21586ac1cc179b734540973 Mon Sep 17 00:00:00 2001 From: "P.SCH" Date: Mon, 9 Apr 2012 09:05:54 +0300 Subject: [PATCH] ZFS list snapshot property alias Add support for the `zfs list -t snap` alias which is available under Oracle Solaris 11. Signed-off-by: Brian Behlendorf Closes #640 --- cmd/zfs/zfs_main.c | 7 ++++--- man/man8/zfs.8 | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 15e224d386..761c9f76a9 100644 --- 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")); @@ -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; diff --git a/man/man8/zfs.8 b/man/man8/zfs.8 index cce0c9d65f..3fd91a99dd 100644 --- a/man/man8/zfs.8 +++ b/man/man8/zfs.8 @@ -75,7 +75,7 @@ zfs \- configures ZFS file systems .LP .nf \fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-H\fR][\fB-o\fR \fIproperty\fR[,...]] [\fB-t\fR \fItype\fR[,...]] - [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ... + [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fIsnap\fR] ... .fi .LP @@ -1471,7 +1471,7 @@ Recursively rename the snapshots of all descendent datasets. Snapshots are the o .ne 2 .mk .na -\fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-H\fR] [\fB-o\fR \fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]] [ \fB-s\fR \fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...\fR +\fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-H\fR] [\fB-o\fR \fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]] [ \fB-s\fR \fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fIsnap\fR] ...\fR .ad .sp .6 .RS 4n