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
Values printed by zpool-iostat(8) should be right-aligned #14751
Values printed by zpool-iostat(8) should be right-aligned #14751
Conversation
This inappropriate left-alignment was introduced in 7bb7b1f. Signed-off-by: WHR <msl0000023508@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fast response and fix @Low-power.
| { | ||
| fputs(" ", stdout); | ||
| size_t len = strlen(statbuf); | ||
| while (len < column_size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a new line before the while() .... but this is cosmetic ;)
| if (*statbuf == '0') { | ||
| color_start(ANSI_GRAY); | ||
| fputc('0', stdout); | ||
| column_size--; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding color_end(); and return; here ....
And we can put the whole for() loop a tab to the left.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. May be we can do these code cleanups later.
Now I also feels that the series of else if inside for should probably be turned into a switch instead for readability.
|
@Low-power thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this PR manually and verified it fixes the column alignment.
This inappropriate left-alignment was introduced in 7bb7b1f. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14751
This inappropriate left-alignment was introduced in 7bb7b1f. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14751
This inappropriate left-alignment was introduced in 7bb7b1f. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14751
Motivation and Context
Fix #14749.
Description
See the title and #14749.
How Has This Been Tested?
Tested locally.
Types of changes
Checklist:
Signed-off-by.