From 10b75496bb0cb7a7b8146c263164adc37f1d176a Mon Sep 17 00:00:00 2001 From: "P.SCH" Date: Thu, 5 Apr 2012 16:03:21 +0300 Subject: 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 Closes #640 --- cmd/zfs/zfs_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd/zfs') 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] ... " "\n")); case HELP_UNMOUNT: return (gettext("\tunmount [-f] " @@ -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 '-?' */ -- cgit v1.2.3