Skip to content

Commit 76eaf37

Browse files
committed
Fix option string, adding -e and fixing order
The recently added '-e' option (PR #15769) missed adding the new option in the online `zpool status` help command. This adds the options and reorders a couple of the other options that were not listed alphabetically. Signed-off-by: Cameron Harr <[email protected]>
1 parent 8f2f6cd commit 76eaf37

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

cmd/zpool/zpool_main.c

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ get_usage(zpool_help_t idx)
413413
"[<device> ...]\n"));
414414
case HELP_STATUS:
415415
return (gettext("\tstatus [--power] [-c [script1,script2,...]] "
416-
"[-igLpPstvxD] [-T d|u] [pool] ... \n"
416+
"[-DegiLpPstvx] [-T d|u] [pool] ...\n"
417417
"\t [interval [count]]\n"));
418418
case HELP_UPGRADE:
419419
return (gettext("\tupgrade\n"
@@ -9177,22 +9177,22 @@ status_callback(zpool_handle_t *zhp, void *data)
91779177
}
91789178

91799179
/*
9180-
* zpool status [-c [script1,script2,...]] [-igLpPstvx] [--power] [-T d|u] ...
9180+
* zpool status [-c [script1,script2,...]] [-DegiLpPstvx] [--power] [-T d|u] ...
91819181
* [pool] [interval [count]]
91829182
*
91839183
* -c CMD For each vdev, run command CMD
9184+
* -D Display dedup status (undocumented)
91849185
* -e Display only unhealthy vdevs
9185-
* -i Display vdev initialization status.
91869186
* -g Display guid for individual vdev name.
9187+
* -i Display vdev initialization status.
91879188
* -L Follow links when resolving vdev path name.
91889189
* -p Display values in parsable (exact) format.
91899190
* -P Display full path for vdev name.
91909191
* -s Display slow IOs column.
9191-
* -v Display complete error logs
9192-
* -x Display only pools with potential problems
9193-
* -D Display dedup status (undocumented)
91949192
* -t Display vdev TRIM status.
91959193
* -T Display a timestamp in date(1) or Unix format
9194+
* -v Display complete error logs
9195+
* -x Display only pools with potential problems
91969196
* --power Display vdev enclosure slot power status
91979197
*
91989198
* Describes the health status of all pools or some subset.
@@ -9213,7 +9213,7 @@ zpool_do_status(int argc, char **argv)
92139213
};
92149214

92159215
/* check options */
9216-
while ((c = getopt_long(argc, argv, "c:eigLpPsvxDtT:", long_options,
9216+
while ((c = getopt_long(argc, argv, "c:DegiLpPstT:vx", long_options,
92179217
NULL)) != -1) {
92189218
switch (c) {
92199219
case 'c':
@@ -9240,15 +9240,18 @@ zpool_do_status(int argc, char **argv)
92409240
}
92419241
cmd = optarg;
92429242
break;
9243+
case 'D':
9244+
cb.cb_dedup_stats = B_TRUE;
9245+
break;
92439246
case 'e':
92449247
cb.cb_print_unhealthy = B_TRUE;
92459248
break;
9246-
case 'i':
9247-
cb.cb_print_vdev_init = B_TRUE;
9248-
break;
92499249
case 'g':
92509250
cb.cb_name_flags |= VDEV_NAME_GUID;
92519251
break;
9252+
case 'i':
9253+
cb.cb_print_vdev_init = B_TRUE;
9254+
break;
92529255
case 'L':
92539256
cb.cb_name_flags |= VDEV_NAME_FOLLOW_LINKS;
92549257
break;
@@ -9261,21 +9264,18 @@ zpool_do_status(int argc, char **argv)
92619264
case 's':
92629265
cb.cb_print_slow_ios = B_TRUE;
92639266
break;
9264-
case 'v':
9265-
cb.cb_verbose = B_TRUE;
9266-
break;
9267-
case 'x':
9268-
cb.cb_explain = B_TRUE;
9269-
break;
9270-
case 'D':
9271-
cb.cb_dedup_stats = B_TRUE;
9272-
break;
92739267
case 't':
92749268
cb.cb_print_vdev_trim = B_TRUE;
92759269
break;
92769270
case 'T':
92779271
get_timestamp_arg(*optarg);
92789272
break;
9273+
case 'v':
9274+
cb.cb_verbose = B_TRUE;
9275+
break;
9276+
case 'x':
9277+
cb.cb_explain = B_TRUE;
9278+
break;
92799279
case POWER_OPT:
92809280
cb.cb_print_power = B_TRUE;
92819281
break;
@@ -9315,7 +9315,6 @@ zpool_do_status(int argc, char **argv)
93159315

93169316
if (cb.vcdl != NULL)
93179317
free_vdev_cmd_data_list(cb.vcdl);
9318-
93199318
if (argc == 0 && cb.cb_count == 0)
93209319
(void) fprintf(stderr, gettext("no pools available\n"));
93219320
else if (cb.cb_explain && cb.cb_first && cb.cb_allpools)

man/man8/zpool-status.8

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
.Sh SYNOPSIS
3737
.Nm zpool
3838
.Cm status
39-
.Op Fl DeigLpPstvx
39+
.Op Fl DegiLpPstvx
4040
.Op Fl T Sy u Ns | Ns Sy d
4141
.Op Fl c Op Ar SCRIPT1 Ns Oo , Ns Ar SCRIPT2 Oc Ns
4242
.Oo Ar pool Oc Ns
@@ -69,14 +69,20 @@ See the
6969
option of
7070
.Nm zpool Cm iostat
7171
for complete details.
72+
.It Fl D
73+
Display a histogram of deduplication statistics, showing the allocated
74+
.Pq physically present on disk
75+
and referenced
76+
.Pq logically referenced in the pool
77+
block counts and sizes by reference count.
7278
.It Fl e
7379
Only show unhealthy vdevs (not-ONLINE or with errors).
74-
.It Fl i
75-
Display vdev initialization status.
7680
.It Fl g
7781
Display vdev GUIDs instead of the normal device names
7882
These GUIDs can be used in place of device names for the zpool
7983
detach/offline/remove/replace commands.
84+
.It Fl i
85+
Display vdev initialization status.
8086
.It Fl L
8187
Display real paths for vdevs resolving all symbolic links.
8288
This can be used to look up the current block device name regardless of the
@@ -90,12 +96,6 @@ the path.
9096
This can be used in conjunction with the
9197
.Fl L
9298
flag.
93-
.It Fl D
94-
Display a histogram of deduplication statistics, showing the allocated
95-
.Pq physically present on disk
96-
and referenced
97-
.Pq logically referenced in the pool
98-
block counts and sizes by reference count.
9999
.It Fl s
100100
Display the number of leaf vdev slow I/O operations.
101101
This is the number of I/O operations that didn't complete in

0 commit comments

Comments
 (0)