diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-11-30 13:11:37 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-11-30 13:11:37 +0000 |
| commit | 80c431c3af17a3f5c86dac722986210ac5675994 (patch) | |
| tree | 36ba06aacad5bf84cf7ad8209b616ee19dfa9ea3 /usr/src/cmd/zfs | |
| parent | 6bd01ddca2d0dd95b05bbc3db21df2e9bc2855b4 (diff) | |
| parent | 5602294fda888d923d57a78bafdaf48ae6223dea (diff) | |
| download | illumos-joyent-80c431c3af17a3f5c86dac722986210ac5675994.tar.gz | |
[illumos-gate merge]
commit 5602294fda888d923d57a78bafdaf48ae6223dea
7252 compressed zfs send / receive
7628 create long versions of ZFS send / receive options
commit 4a6959565df1e2af817732421764a9da2f446da9
6911 nfs4: unexpected permission denied
Diffstat (limited to 'usr/src/cmd/zfs')
| -rw-r--r-- | usr/src/cmd/zfs/zfs_main.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c index 7d9153f9fe..0132ab81bb 100644 --- a/usr/src/cmd/zfs/zfs_main.c +++ b/usr/src/cmd/zfs/zfs_main.c @@ -34,6 +34,7 @@ #include <assert.h> #include <ctype.h> #include <errno.h> +#include <getopt.h> #include <libgen.h> #include <libintl.h> #include <libuutil.h> @@ -262,7 +263,7 @@ get_usage(zfs_help_t idx) case HELP_ROLLBACK: return (gettext("\trollback [-rRf] <snapshot>\n")); case HELP_SEND: - return (gettext("\tsend [-DnPpRvLe] [-[iI] snapshot] " + return (gettext("\tsend [-DnPpRvLec] [-[iI] snapshot] " "<snapshot>\n" "\tsend [-Le] [-i snapshot|bookmark] " "<filesystem|volume|snapshot>\n" @@ -3784,8 +3785,23 @@ zfs_do_send(int argc, char **argv) nvlist_t *dbgnv = NULL; boolean_t extraverbose = B_FALSE; + struct option long_options[] = { + {"replicate", no_argument, NULL, 'R'}, + {"props", no_argument, NULL, 'p'}, + {"parsable", no_argument, NULL, 'P'}, + {"dedup", no_argument, NULL, 'D'}, + {"verbose", no_argument, NULL, 'v'}, + {"dryrun", no_argument, NULL, 'n'}, + {"large-block", no_argument, NULL, 'L'}, + {"embed", no_argument, NULL, 'e'}, + {"resume", required_argument, NULL, 't'}, + {"compressed", no_argument, NULL, 'c'}, + {0, 0, 0, 0} + }; + /* check options */ - while ((c = getopt(argc, argv, ":i:I:RDpvnPLet:")) != -1) { + while ((c = getopt_long(argc, argv, ":i:I:RbDpvnPLet:c", long_options, + NULL)) != -1) { switch (c) { case 'i': if (fromname) @@ -3829,12 +3845,17 @@ zfs_do_send(int argc, char **argv) case 't': resume_token = optarg; break; + case 'c': + flags.compress = B_TRUE; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); usage(B_FALSE); break; case '?': + /*FALLTHROUGH*/ + default: (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); usage(B_FALSE); @@ -3905,6 +3926,8 @@ zfs_do_send(int argc, char **argv) lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; if (flags.embed_data) lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + if (flags.compress) + lzc_flags |= LZC_SEND_FLAG_COMPRESS; if (fromname != NULL && (fromname[0] == '#' || fromname[0] == '@')) { |
