free: Adjust space to really use 9 chars
@steffhip found that while the translation hint said use 9 characters in the free headers, it really was only 7. Currently each line is constructed with the following (in non wide format): Header + 6 Columns. The header takes 7 characters and each column is 11 characters wide and prefixed with one space. Thus we have 7 + (1 + 11) * 6 = 79 characters for each line By dropping the leading space for the first column after the header -the header is already terminated by a colon- one could indeed provide the needed 9 letters for the header and thus have 9 + 11 * 1 + (1 + 11) * 5 = 80 Chars per line which would fit into one line.
This commit is contained in:
parent
6442a631ac
commit
91a396d76e
10
free.c
10
free.c
@ -354,7 +354,7 @@ int main(int argc, char **argv)
|
|||||||
printf(_(" total used free shared buff/cache available"));
|
printf(_(" total used free shared buff/cache available"));
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("%-7s", _("Mem:"));
|
printf("%-9s", _("Mem:"));
|
||||||
printf("%11s", scale_size(kb_main_total, flags, args));
|
printf("%11s", scale_size(kb_main_total, flags, args));
|
||||||
printf(" %11s", scale_size(kb_main_used, flags, args));
|
printf(" %11s", scale_size(kb_main_used, flags, args));
|
||||||
printf(" %11s", scale_size(kb_main_free, flags, args));
|
printf(" %11s", scale_size(kb_main_free, flags, args));
|
||||||
@ -374,27 +374,27 @@ int main(int argc, char **argv)
|
|||||||
* to print the high info, even if it is zero.
|
* to print the high info, even if it is zero.
|
||||||
*/
|
*/
|
||||||
if (flags & FREE_LOHI) {
|
if (flags & FREE_LOHI) {
|
||||||
printf("%-7s", _("Low:"));
|
printf("%-9s", _("Low:"));
|
||||||
printf("%11s", scale_size(kb_low_total, flags, args));
|
printf("%11s", scale_size(kb_low_total, flags, args));
|
||||||
printf(" %11s", scale_size(kb_low_total - kb_low_free, flags, args));
|
printf(" %11s", scale_size(kb_low_total - kb_low_free, flags, args));
|
||||||
printf(" %11s", scale_size(kb_low_free, flags, args));
|
printf(" %11s", scale_size(kb_low_free, flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
printf("%-7s", _("High:"));
|
printf("%-9s", _("High:"));
|
||||||
printf("%11s", scale_size(kb_high_total, flags, args));
|
printf("%11s", scale_size(kb_high_total, flags, args));
|
||||||
printf(" %11s", scale_size(kb_high_total - kb_high_free, flags, args));
|
printf(" %11s", scale_size(kb_high_total - kb_high_free, flags, args));
|
||||||
printf(" %11s", scale_size(kb_high_free, flags, args));
|
printf(" %11s", scale_size(kb_high_free, flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%-7s", _("Swap:"));
|
printf("%-9s", _("Swap:"));
|
||||||
printf("%11s", scale_size(kb_swap_total, flags, args));
|
printf("%11s", scale_size(kb_swap_total, flags, args));
|
||||||
printf(" %11s", scale_size(kb_swap_used, flags, args));
|
printf(" %11s", scale_size(kb_swap_used, flags, args));
|
||||||
printf(" %11s", scale_size(kb_swap_free, flags, args));
|
printf(" %11s", scale_size(kb_swap_free, flags, args));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
if (flags & FREE_TOTAL) {
|
if (flags & FREE_TOTAL) {
|
||||||
printf("%-7s", _("Total:"));
|
printf("%-9s", _("Total:"));
|
||||||
printf("%11s", scale_size(kb_main_total + kb_swap_total, flags, args));
|
printf("%11s", scale_size(kb_main_total + kb_swap_total, flags, args));
|
||||||
printf(" %11s", scale_size(kb_main_used + kb_swap_used, flags, args));
|
printf(" %11s", scale_size(kb_main_used + kb_swap_used, flags, args));
|
||||||
printf(" %11s", scale_size(kb_main_free + kb_swap_free, flags, args));
|
printf(" %11s", scale_size(kb_main_free + kb_swap_free, flags, args));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user