svn commit: r263404 - in stable: 8/cddl/contrib/opensolaris/cmd/zfs 9/cddl/contrib/opensolaris/cmd/zfs

Xin LI delphij at FreeBSD.org
Thu Mar 20 00:14:46 UTC 2014


Author: delphij
Date: Thu Mar 20 00:14:45 2014
New Revision: 263404
URL: http://svnweb.freebsd.org/changeset/base/263404

Log:
  MFC r256999 (smh):
  
  Added support for the 'zfs list -t snap' and 'zfs snap' aliases which are
  available under Oracle Solaris 11.
  
  This includes an update to the ZFS(8) man page to reflect all the
  available alias (snap, umount, and recv).
  
  Initial changes obtained from ZFS On Linux + fixes for man page and cmd
  help:
  https://github.com/zfsonlinux/zfs/commit/10b75496bb0cb7a7b8146c263164adc37f1d176a
  https://github.com/zfsonlinux/zfs/commit/cf81b00a73fe47fdb21586ac1cc179b734540973
  
  Obtained from:  https://github.com/zfsonlinux/zfs

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)
  stable/9/cddl/contrib/opensolaris/cmd/zfs/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Thu Mar 20 00:10:58 2014	(r263403)
+++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Thu Mar 20 00:14:45 2014	(r263404)
@@ -25,10 +25,11 @@
 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
 .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved.
 .\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
+.\" Copyright (c) 2013, Steven Hartland <smh at FreeBSD.org>
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 20, 2013
+.Dd October 23, 2013
 .Dt ZFS 8
 .Os
 .Sh NAME
@@ -61,7 +62,7 @@
 .Op , Ns ...
 .Sm on
 .Nm
-.Cm snapshot
+.Cm snapshot Ns | Ns Cm snap
 .Op Fl r
 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
 .Ar filesystem at snapname Ns | Ns Ar volume at snapname
@@ -157,7 +158,7 @@
 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
 .Fl a | Ar filesystem
 .Nm
-.Cm unmount
+.Cm unmount Ns | Ns Cm umount
 .Op Fl f
 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
 .Nm
@@ -172,11 +173,11 @@
 .Op Fl i Ar snapshot | Fl I Ar snapshot
 .Ar snapshot
 .Nm
-.Cm receive
+.Cm receive Ns | Ns Cm recv
 .Op Fl vnFu
 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
 .Nm
-.Cm receive
+.Cm receive Ns | Ns Cm recv
 .Op Fl vnFu
 .Op Fl d | e
 .Ar filesystem
@@ -1645,7 +1646,7 @@ options, as they can destroy large porti
 behavior for mounted file systems in use.
 .It Xo
 .Nm
-.Cm snapshot
+.Cm snapshot Ns | Ns Cm snap
 .Op Fl r
 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
 .Ar filesystem at snapname Ns | Ns volume at snapname
@@ -1857,7 +1858,7 @@ syntax.
 A comma-separated list of types to display, where
 .Ar type
 is one of
-.Sy filesystem , snapshot , volume , No or Sy all .
+.Sy filesystem , snapshot , snap,  volume , No or Sy all .
 For example, specifying
 .Fl t Cm snapshot
 displays only snapshots.
@@ -2186,7 +2187,7 @@ Mount the specified filesystem.
 .El
 .It Xo
 .Nm
-.Cm unmount
+.Cm unmount Ns | Ns Cm umount
 .Op Fl f
 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
 .Xc
@@ -2369,13 +2370,13 @@ on future versions of
 .Tn ZFS .
 .It Xo
 .Nm
-.Cm receive
+.Cm receive Ns | Ns Cm recv
 .Op Fl vnFu
 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
 .Xc
 .It Xo
 .Nm
-.Cm receive
+.Cm receive Ns | Ns Cm recv
 .Op Fl vnFu
 .Op Fl d | e
 .Ar filesystem

Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Thu Mar 20 00:10:58 2014	(r263403)
+++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Thu Mar 20 00:14:45 2014	(r263404)
@@ -257,9 +257,9 @@ get_usage(zfs_help_t idx)
 	case HELP_PROMOTE:
 		return (gettext("\tpromote <clone-filesystem>\n"));
 	case HELP_RECEIVE:
-		return (gettext("\treceive [-vnFu] <filesystem|volume|"
+		return (gettext("\treceive|recv [-vnFu] <filesystem|volume|"
 		"snapshot>\n"
-		"\treceive [-vnFu] [-d | -e] <filesystem>\n"));
+		"\treceive|recv [-vnFu] [-d | -e] <filesystem>\n"));
 	case HELP_RENAME:
 		return (gettext("\trename [-f] <filesystem|volume|snapshot> "
 		    "<filesystem|volume|snapshot>\n"
@@ -278,10 +278,10 @@ 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] ... "
 		    "<filesystem at snapname|volume at snapname> ...\n"));
 	case HELP_UNMOUNT:
-		return (gettext("\tunmount [-f] "
+		return (gettext("\tunmount|umount [-f] "
 		    "<-a | filesystem|mountpoint>\n"));
 	case HELP_UNSHARE:
 		return (gettext("\tunshare "
@@ -3014,7 +3014,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)) {
@@ -3025,9 +3025,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;
 
@@ -6713,6 +6714,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)


More information about the svn-src-all mailing list