Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs_main: fix alignment on props usage output #16883

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

robn
Copy link
Member

@robn robn commented Dec 18, 2024

Motivation and Context

Just playing with some ideas for alternate property display, and this stuck out as a very easy thing to tidy up.

Description

Make the property name column wider, so the columns align nicely.

How Has This Been Tested?

Just looking at it.

$ zfs get
...
	PROPERTY       EDIT  INHERIT   VALUES
...
	defer_destroy    NO       NO   yes | no
	encryptionroot   NO       NO   <filesystem | volume>
	filesystem_count  NO       NO   <count>
	guid             NO       NO   <uint64>
	keystatus        NO       NO   none | unavailable | available
	logicalreferenced  NO       NO   <size>
	logicalused      NO       NO   <size>
	mounted          NO       NO   yes | no
	objsetid         NO       NO   <uint64>
	origin           NO       NO   <snapshot>
	receive_resume_token  NO       NO   <string token>
	redact_snaps     NO       NO   <snapshot>[,...]
	refcompressratio  NO       NO   <1.00x or higher if compressed>
	referenced       NO       NO   <size>
	snapshot_count   NO       NO   <count>
	snapshots_changed  NO       NO   <date>
	type             NO       NO   filesystem | volume | snapshot | bookmark
	used             NO       NO   <size>
	usedbychildren   NO       NO   <size>
...
$ ./zfs get
...
	PROPERTY              EDIT  INHERIT   VALUES
...
	defer_destroy           NO       NO   yes | no
	encryptionroot          NO       NO   <filesystem | volume>
	filesystem_count        NO       NO   <count>
	guid                    NO       NO   <uint64>
	keystatus               NO       NO   none | unavailable | available
	logicalreferenced       NO       NO   <size>
	logicalused             NO       NO   <size>
	mounted                 NO       NO   yes | no
	objsetid                NO       NO   <uint64>
	origin                  NO       NO   <snapshot>
	receive_resume_token    NO       NO   <string token>
	redact_snaps            NO       NO   <snapshot>[,...]
	refcompressratio        NO       NO   <1.00x or higher if compressed>
	referenced              NO       NO   <size>
	snapshot_count          NO       NO   <count>
	snapshots_changed       NO       NO   <date>
	type                    NO       NO   filesystem | volume | snapshot | bookmark
	used                    NO       NO   <size>
	usedbychildren          NO       NO   <size>
...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

I guess we've got some long property names since this was first set up!

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <[email protected]>
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether we really need the first tab. There are too many lines that don't fit 80 columns. And we already use 4 spaces indentation at the last paragraph.

@amotin amotin added the Status: Code Review Needed Ready for review and testing label Dec 18, 2024
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 18, 2024
@robn
Copy link
Member Author

robn commented Dec 19, 2024

I wonder whether we really need the first tab. There are too many lines that don't fit 80 columns. And we already use 4 spaces indentation at the last paragraph.

@amotin yeah, it's not amazing hey. I've scribbled it down on my list of things that could be nicer here, cheers.

@amotin amotin merged commit f00a57a into openzfs:master Dec 19, 2024
24 of 26 checks passed
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Dec 29, 2024
I guess we've got some long property names since this was first set up!

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#16883
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Jan 26, 2025
I guess we've got some long property names since this was first set up!

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#16883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants