diff options
author | Turbo Fredriksson <[email protected]> | 2014-07-23 12:14:09 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-07-25 11:58:36 -0700 |
commit | 79eb71dc6ca16d57893fb06ad6f8b73656651c60 (patch) | |
tree | 126527052b8a50f2b2f7a6ad6ed28af8d5a48ba8 | |
parent | a60e668bd2d4c91ce1398bcf2f51636973abdd19 (diff) |
Support '-H' (scripted mode) to 'zpool get'
This functionality is already available in 'zfs get'. Providing
it for 'zpool get' is useful and good for consistency.
Signed-off-by: Turbo Fredriksson <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes: #2522
-rw-r--r-- | cmd/zpool/zpool_main.c | 8 | ||||
-rw-r--r-- | man/man8/zpool.8 | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 8a0fa2c2b..77c68d74d 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -266,7 +266,7 @@ get_usage(zpool_help_t idx) { case HELP_EVENTS: return (gettext("\tevents [-vHfc]\n")); case HELP_GET: - return (gettext("\tget [-p] <\"all\" | property[,...]> " + return (gettext("\tget [-pH] <\"all\" | property[,...]> " "<pool> ...\n")); case HELP_SET: return (gettext("\tset <property=value> <pool> \n")); @@ -5617,12 +5617,16 @@ zpool_do_get(int argc, char **argv) int c, ret; /* check options */ - while ((c = getopt(argc, argv, "p")) != -1) { + while ((c = getopt(argc, argv, "pH")) != -1) { switch (c) { case 'p': cb.cb_literal = B_TRUE; break; + case 'H': + cb.cb_scripted = B_TRUE; + break; + case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); diff --git a/man/man8/zpool.8 b/man/man8/zpool.8 index e0d91d94c..0b57bf6bb 100644 --- a/man/man8/zpool.8 +++ b/man/man8/zpool.8 @@ -62,7 +62,7 @@ zpool \- configures ZFS storage pools .LP .nf -\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ... +\fBzpool get\fR [\fB-pH\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ... .fi .LP @@ -1079,6 +1079,17 @@ See the "Properties" section for more information on the available pool properti Display numbers in parseable (exact) values. .RE +.sp +.ne 2 +.mk +.na +\fB\fB-H\fR\fR +.ad +.RS 6n +.rt +Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. +.RE + .RE .sp |