summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2013-10-17 19:33:28 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2013-10-17 19:33:28 +0000
commit145c84b421a63c5fde8c32b7ff4e7de29e886963 (patch)
tree3d19fab2da159f60f1833261b46e53621654f2c5
parent6cf6cdf0602314dd43652e4ab9db8d2245615214 (diff)
downloadillumos-joyent-145c84b421a63c5fde8c32b7ff4e7de29e886963.tar.gz
OS-2563 zpool get -p is broken20131017release-20131017
-rw-r--r--usr/src/cmd/zpool/zpool_main.c10
-rw-r--r--usr/src/man/man1m/zpool.1m5
2 files changed, 9 insertions, 6 deletions
diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c
index 04ad2eb5d3..e77a86fa8a 100644
--- a/usr/src/cmd/zpool/zpool_main.c
+++ b/usr/src/cmd/zpool/zpool_main.c
@@ -25,6 +25,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012 by Frederik Wessels. All rights reserved.
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
#include <assert.h>
@@ -5002,7 +5003,7 @@ zpool_do_get(int argc, char **argv)
char c;
/* check options */
- while ((c = getopt(argc, argv, ":p")) != -1) {
+ while ((c = getopt(argc, argv, "p")) != -1) {
switch (c) {
case 'p':
cb.cb_literal = B_TRUE;
@@ -5014,6 +5015,9 @@ zpool_do_get(int argc, char **argv)
}
}
+ argc -= optind;
+ argv += optind;
+
if (argc < 2) {
(void) fprintf(stderr, gettext("missing property "
"argument\n"));
@@ -5028,7 +5032,7 @@ zpool_do_get(int argc, char **argv)
cb.cb_columns[3] = GET_COL_SOURCE;
cb.cb_type = ZFS_TYPE_POOL;
- if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist,
+ if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist,
ZFS_TYPE_POOL) != 0)
usage(B_FALSE);
@@ -5039,7 +5043,7 @@ zpool_do_get(int argc, char **argv)
cb.cb_proplist = &fake_name;
}
- ret = for_each_pool(argc - 2, argv + 2, B_TRUE, &cb.cb_proplist,
+ ret = for_each_pool(argc - 1, argv + 1, B_TRUE, &cb.cb_proplist,
get_callback, &cb);
if (cb.cb_proplist == &fake_name)
diff --git a/usr/src/man/man1m/zpool.1m b/usr/src/man/man1m/zpool.1m
index 45792c2b92..ac5fca0f69 100644
--- a/usr/src/man/man1m/zpool.1m
+++ b/usr/src/man/man1m/zpool.1m
@@ -1,6 +1,6 @@
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved.
+.\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved.
.\" Copyright (c) 2012 by Delphix. All rights reserved.
.\" The contents of this file are subject to the terms of the Common Development
@@ -1145,7 +1145,6 @@ the following fields:
See the "Properties" section for more information on the available pool
properties.
-.RE
.sp
.ne 2
@@ -1153,10 +1152,10 @@ properties.
\fB\fB-p\fR\fR
.ad
.RS 6n
-.rt
Display numbers in parseable (exact) values.
.RE
+.RE
.sp
.ne 2