ZFS snapshot alias
[zfs.git] / cmd / zfs / zfs_main.c
index b88ab09..15e224d 100644 (file)
@@ -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) ||