diff options
author | Allan Jude <allanjude@freebsd.org> | 2017-10-31 21:41:46 -0400 |
---|---|---|
committer | Prakash Surya <prakash.surya@delphix.com> | 2018-01-18 14:00:51 -0800 |
commit | e9b7d6e7f7a6477679a35b73eb3934b096b3dd39 (patch) | |
tree | 7cadab648b2490602cdc774cdb73a9a8c763163e | |
parent | 5cb8d943bc8513c6230589aad5a409d58b0297cb (diff) | |
download | illumos-joyent-e9b7d6e7f7a6477679a35b73eb3934b096b3dd39.tar.gz |
8972 zfs holds: In scripted mode, do not pad columns with spaces
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/cmd/zfs/zfs_main.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c index c6cc0d500e..51142a5745 100644 --- a/usr/src/cmd/zfs/zfs_main.c +++ b/usr/src/cmd/zfs/zfs_main.c @@ -5603,8 +5603,6 @@ print_holds(boolean_t scripted, size_t nwidth, size_t tagwidth, nvlist_t *nvl) uint64_t val = 0; time_t time; struct tm t; - char sep = scripted ? '\t' : ' '; - size_t sepnum = scripted ? 1 : 2; (void) nvpair_value_uint64(nvp2, &val); time = (time_t)val; @@ -5612,8 +5610,13 @@ print_holds(boolean_t scripted, size_t nwidth, size_t tagwidth, nvlist_t *nvl) (void) strftime(tsbuf, DATETIME_BUF_LEN, gettext(STRFTIME_FMT_STR), &t); - (void) printf("%-*s%*c%-*s%*c%s\n", nwidth, zname, - sepnum, sep, tagwidth, tagname, sepnum, sep, tsbuf); + if (scripted) { + (void) printf("%s\t%s\t%s\n", zname, + tagname, tsbuf); + } else { + (void) printf("%-*s %-*s %s\n", nwidth, + zname, tagwidth, tagname, tsbuf); + } } } } |