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 <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #2522
This commit is contained in:
Turbo Fredriksson
2014-07-23 12:14:09 +02:00
committed by Brian Behlendorf
parent a60e668bd2
commit 79eb71dc6c
2 changed files with 18 additions and 3 deletions
+6 -2
View File
@@ -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);