Skip to content

Commit 10b7549

Browse files
pyavdrbehlendorf
authored andcommitted
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 <behlendorf1@llnl.gov> Closes #640
1 parent 7d5cd71 commit 10b7549

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cmd/zfs/zfs_main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ get_usage(zfs_help_t idx)
254254
case HELP_SHARE:
255255
return (gettext("\tshare <-a | filesystem>\n"));
256256
case HELP_SNAPSHOT:
257-
return (gettext("\tsnapshot [-r] [-o property=value] ... "
257+
return (gettext("\tsnapshot|snap [-r] [-o property=value] ... "
258258
"<filesystem@snapname|volume@snapname>\n"));
259259
case HELP_UNMOUNT:
260260
return (gettext("\tunmount [-f] "
@@ -6161,6 +6161,12 @@ main(int argc, char **argv)
61616161
if (strcmp(cmdname, "recv") == 0)
61626162
cmdname = "receive";
61636163

6164+
/*
6165+
* The 'snap' command is an alias for 'snapshot'
6166+
*/
6167+
if (strcmp(cmdname, "snap") == 0)
6168+
cmdname = "snapshot";
6169+
61646170
/*
61656171
* Special case '-?'
61666172
*/

man/man8/zfs.8

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ zfs \- configures ZFS file systems
3737

3838
.LP
3939
.nf
40-
\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]...
40+
\fBzfs\fR \fBsnapshot | snap\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]...
4141
\fIfilesystem@snapname\fR|\fIvolume@snapname\fR
4242
.fi
4343

@@ -128,7 +128,7 @@ zfs \- configures ZFS file systems
128128

129129
.LP
130130
.nf
131-
\fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
131+
\fBzfs\fR \fBunmount | umount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
132132
.fi
133133

134134
.LP
@@ -148,12 +148,12 @@ zfs \- configures ZFS file systems
148148

149149
.LP
150150
.nf
151-
\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
151+
\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
152152
.fi
153153

154154
.LP
155155
.nf
156-
\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR
156+
\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR
157157
.fi
158158

159159
.LP

0 commit comments

Comments
 (0)