zfs/cmd
Pawel Jakub Dawidek 5137c132a5
zpool import output is not formated properly.
The 'zpool status' output assumes that the longest prefix is six
character long plus colon plus space, eg. 'status: ', 'action: '
or 'config: ' (so eight in total). This works well even when we have
messages that requires more than one line, as '\t' is exactly eight
characters, just like the longest prefix.

The 'zpool import' output is a bit different, as it may display the
comment pool property, then the longest prefix is 'comment: ', which is
nine characters long, not eight.
All the prefixes were given an extra space in front, but:
- 'status: ' did not get an extra space.
- Messages that require more than one line should use nine spaces of
  indentation, not eight.
- The extra space in front looks redundant if there is no comment
  property set on the given pool.

Fix it by adding an extra space to all prefixes, but only if the comment
property is defined. Also, when we need to continue the message in a new
line, use '\t ' for indentation.

While here, apply small corrections to a couple messages.

Before:

   pool: tank
     id: 7412636063178848859
  state: ONLINE
status: Some supported features are not enabled on the pool.
	(Note that they may be intentionally disabled if the
	'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identif[...]
	some features will not be available without an explicit 'zp[...]
comment: Example comment.
 config:

	bclone      ONLINE
	  ada0      ONLINE

After:

  pool: tank
    id: 10180960571062436759
 state: ONLINE
status: Some supported features are not enabled on the pool.
	(Note that they may be intentionally disabled if the
	'compatibility' property is set.)
action: The pool can be imported using its name or numeric identifi[...]
	some features will not be available without an explicit 'zp[...]
config:

	tank        ONLINE
	  ada3      ONLINE

   pool: dozer
     id: 11028319538368222579
  state: ONLINE
 status: Some supported features are not enabled on the pool.
	 (Note that they may be intentionally disabled if the
	 'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identif[...]
	 some features will not be available without an explicit 'z[...]
comment: Example comment.
 config:

	dozer       ONLINE
	  ada1      ONLINE

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Dawidek <pawel@dawidek.net>
Closes #16128
2024-05-29 13:34:59 -07:00
..
raidz_test RAID-Z expansion feature 2023-11-08 10:19:41 -08:00
zdb zdb/ztest: send dbgmsg output to stderr 2024-05-14 09:49:00 -07:00
zed zed: Add deadman-slot_off.sh zedlet 2024-05-29 10:46:41 -07:00
zfs Better control the thread pool size when mounting datasets 2024-05-14 09:36:21 -07:00
zinject Parallel pool import 2024-04-22 09:42:38 -07:00
zpool zpool import output is not formated properly. 2024-05-29 13:34:59 -07:00
zpool_influxdb Do not report bytes skipped by scan as issued. 2023-06-30 08:47:13 -07:00
zstream Use memset to zero stack allocations containing unions 2024-05-24 19:00:29 -07:00
Makefile.am config: use -Wno-format-truncation globally 2024-02-26 12:23:55 -08:00
arc_summary Speculative prefetch for reordered requests 2024-04-08 15:13:27 -07:00
arcstat.in Fix arcstats for FreeBSD after zfetch support 2024-04-29 13:28:50 -07:00
dbufstat.in Consider `dnode_t` allocations in dbuf cache size accounting 2023-11-17 13:25:53 -08:00
fsck.zfs.in cmd: move single-file binaries up, extract udev programs to udev/ 2022-05-10 10:20:34 -07:00
mount_zfs.c nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
zfs_ids_to_path.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zgenhostid.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zhack.c Provide macros for setting and getting blkptr birth times 2024-03-25 15:01:54 -07:00
zilstat.in zil: Add some more statistics. 2023-05-25 13:51:53 -07:00
ztest.c zdb/ztest: send dbgmsg output to stderr 2024-05-14 09:49:00 -07:00
zvol_wait zvol_wait logic may terminate prematurely 2022-10-11 12:12:04 -07:00