Skip to content

Commit

Permalink
ZFS snapshot alias
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Closes #640
  • Loading branch information
pyavdr authored and behlendorf committed Apr 11, 2012
1 parent 7d5cd71 commit 10b7549
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] "
Expand Down Expand Up @@ -6161,6 +6161,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 '-?'
*/
Expand Down
8 changes: 4 additions & 4 deletions man/man8/zfs.8
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 10b7549

Please sign in to comment.