summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP.SCH <[email protected]>2012-04-05 16:03:21 +0300
committerBrian Behlendorf <[email protected]>2012-04-11 12:02:31 -0700
commit10b75496bb0cb7a7b8146c263164adc37f1d176a (patch)
tree556e7034559784c45320786ebc949e8ac7f75000
parent7d5cd71da6987565d19701b1d102f882f659b815 (diff)
ZFS snapshot alias
For consistency, and because it's handy, add the 'zfs snap' alias which was introduced by Oracle Solaris 11. This includes an update to the man page to reflect all the available alias (snap, umount, and recv). Signed-off-by: Brian Behlendorf <[email protected]> Closes #640
-rw-r--r--cmd/zfs/zfs_main.c8
-rw-r--r--man/man8/zfs.88
2 files changed, 11 insertions, 5 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index b88ab0986..15e224d38 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -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] ... "
"<filesystem@snapname|volume@snapname>\n"));
case HELP_UNMOUNT:
return (gettext("\tunmount [-f] "
@@ -6162,6 +6162,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) ||
diff --git a/man/man8/zfs.8 b/man/man8/zfs.8
index d2372695d..cce0c9d65 100644
--- a/man/man8/zfs.8
+++ b/man/man8/zfs.8
@@ -37,7 +37,7 @@ zfs \- configures ZFS file systems
.LP
.nf
-\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]...
+\fBzfs\fR \fBsnapshot | snap\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]...
\fIfilesystem@snapname\fR|\fIvolume@snapname\fR
.fi
@@ -128,7 +128,7 @@ zfs \- configures ZFS file systems
.LP
.nf
-\fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
+\fBzfs\fR \fBunmount | umount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
.fi
.LP
@@ -148,12 +148,12 @@ zfs \- configures ZFS file systems
.LP
.nf
-\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
+\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
.fi
.LP
.nf
-\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR
+\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR
.fi
.LP