* [PATCH] swapon: align --summary fields
@ 2014-06-29 18:12 Sami Kerola
2014-06-30 8:46 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Sami Kerola @ 2014-06-29 18:12 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
This commit makes partitions and files to have remaining three columns
aligned. Below print out demonstrates earlier misalignment.
$ swapon -s
Filename Type Size Used Priority
/dev/sda2 partition 4194300 0 3
/home/src/util-linux/newswap file 496 0 -1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
sys-utils/swapon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c
index 8c36b2c..53cd6f9 100644
--- a/sys-utils/swapon.c
+++ b/sys-utils/swapon.c
@@ -209,7 +209,7 @@ static int display_summary(void)
printf(_("%s\t\t\t\tType\t\tSize\tUsed\tPriority\n"), _("Filename"));
while (mnt_table_next_fs(st, itr, &fs) == 0) {
- printf("%-39s\t%s\t%jd\t%jd\t%d\n",
+ printf("%-39s\t%-8s\t%jd\t%jd\t%d\n",
mnt_fs_get_source(fs),
mnt_fs_get_swaptype(fs),
mnt_fs_get_size(fs),
--
2.0.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] swapon: align --summary fields
2014-06-29 18:12 [PATCH] swapon: align --summary fields Sami Kerola
@ 2014-06-30 8:46 ` Karel Zak
0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-06-30 8:46 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sun, Jun 29, 2014 at 07:12:13PM +0100, Sami Kerola wrote:
> This commit makes partitions and files to have remaining three columns
> aligned. Below print out demonstrates earlier misalignment.
>
> $ swapon -s
> Filename Type Size Used Priority
> /dev/sda2 partition 4194300 0 3
> /home/src/util-linux/newswap file 496 0 -1
>
> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
> ---
> sys-utils/swapon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Maybe we can mark the --summary output format deprecated in favour of
--show. The old fixed output sucks.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-30 8:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-29 18:12 [PATCH] swapon: align --summary fields Sami Kerola
2014-06-30 8:46 ` Karel Zak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.