aboutsummaryrefslogtreecommitdiff
path: root/cddl
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2019-09-22 08:34:23 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-09-22 08:34:23 +0000
commit62dd1037a967deecdae7d0cf37e61aefb65e69ca (patch)
tree793be1397318546cc5daf759913b53a9c6f36738 /cddl
parentf33533da8c13431673499205b7f020d976830606 (diff)
downloadsrc-62dd1037a967deecdae7d0cf37e61aefb65e69ca.tar.gz
src-62dd1037a967deecdae7d0cf37e61aefb65e69ca.zip
print summary line for space estimate of zfs send from bookmark
Although there is always a single stream and the total size in the summary is always equal to the size reported for the stream, it's nice to follow the usual output format. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=352590
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
index 290b8926d3a3..4b2122c2a501 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
@@ -2054,6 +2054,15 @@ zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, sendflags_t flags)
if (err == 0) {
send_print_verbose(fout, zhp->zfs_name, from, size,
flags.parsable);
+ if (flags.parsable) {
+ (void) fprintf(fout, "size\t%llu\n",
+ (longlong_t)size);
+ } else {
+ char buf[16];
+ zfs_nicenum(size, buf, sizeof (buf));
+ (void) fprintf(fout, dgettext(TEXT_DOMAIN,
+ "total estimated size is %s\n"), buf);
+ }
} else {
(void) fprintf(stderr, "Cannot estimate send size: "
"%s\n", strerror(errno));