diff options
author | delphij <delphij@FreeBSD.org> | 2014-03-20 00:10:58 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-03-20 00:10:58 +0000 |
commit | 18a0059ca290db4bfebd9a20646d1a068c5964df (patch) | |
tree | fc94e23d6a041096d916166f841770b90946a6d3 /cddl/contrib/opensolaris/cmd/zfs/zfs_main.c | |
parent | 5cc12e5eafe8e508a56b55169b83b862188a78a8 (diff) | |
download | FreeBSD-src-18a0059ca290db4bfebd9a20646d1a068c5964df.zip FreeBSD-src-18a0059ca290db4bfebd9a20646d1a068c5964df.tar.gz |
MFC r256999 (smh):
Added support for the 'zfs list -t snap' and 'zfs snap' aliases which are
available under Oracle Solaris 11.
This includes an update to the ZFS(8) man page to reflect all the
available alias (snap, umount, and recv).
Initial changes obtained from ZFS On Linux + fixes for man page and cmd
help:
https://github.com/zfsonlinux/zfs/commit/10b75496bb0cb7a7b8146c263164adc37f1d176a
https://github.com/zfsonlinux/zfs/commit/cf81b00a73fe47fdb21586ac1cc179b734540973
Obtained from: https://github.com/zfsonlinux/zfs
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zfs/zfs_main.c')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zfs/zfs_main.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c index e3bf7ca..81e6e8c 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c @@ -259,9 +259,9 @@ get_usage(zfs_help_t idx) case HELP_PROMOTE: return (gettext("\tpromote <clone-filesystem>\n")); case HELP_RECEIVE: - return (gettext("\treceive [-vnFu] <filesystem|volume|" + return (gettext("\treceive|recv [-vnFu] <filesystem|volume|" "snapshot>\n" - "\treceive [-vnFu] [-d | -e] <filesystem>\n")); + "\treceive|recv [-vnFu] [-d | -e] <filesystem>\n")); case HELP_RENAME: return (gettext("\trename [-f] <filesystem|volume|snapshot> " "<filesystem|volume|snapshot>\n" @@ -280,10 +280,10 @@ 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] " + return (gettext("\tunmount|umount [-f] " "<-a | filesystem|mountpoint>\n")); case HELP_UNSHARE: return (gettext("\tunshare " @@ -3027,7 +3027,7 @@ zfs_do_list(int argc, char **argv) flags &= ~ZFS_ITER_PROP_LISTSNAPS; while (*optarg != '\0') { static char *type_subopts[] = { "filesystem", - "volume", "snapshot", "all", NULL }; + "volume", "snapshot", "snap", "all", NULL }; switch (getsubopt(&optarg, type_subopts, &value)) { @@ -3038,9 +3038,10 @@ zfs_do_list(int argc, char **argv) types |= ZFS_TYPE_VOLUME; break; case 2: + case 3: types |= ZFS_TYPE_SNAPSHOT; break; - case 3: + case 4: types = ZFS_TYPE_DATASET; break; @@ -6726,6 +6727,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) |