All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: Hannes Reinecke <hare@suse.de>,
	linux-nvme@lists.infradead.org,  kbusch@kernel.org,
	gjoyce@ibm.com
Subject: Re: [PATCHv2 3/4] nvme: add common APIs for printing tabular format output
Date: Wed, 20 Aug 2025 10:23:15 +0200	[thread overview]
Message-ID: <ddf7e643-75ad-4878-bad3-11b60dfd95ec@flourine.local> (raw)
In-Reply-To: <d7a65049-01e1-443d-9315-6ce8b9e9024f@linux.ibm.com>

On Tue, Aug 19, 2025 at 02:26:19PM +0530, Nilay Shroff wrote:
> > Sheesh. Can o'worms.
> > 
> > Displaying a table on an ASCII terminal is black magic (check
> > manpage for ncurses ...), and I'm pretty certain that printing
> > spaces for alignment is _not_ the way to go.
> > If you really want to implement this then at the very least use
> > tabs. Ideally check with the ncurses manpage how one can display
> > a table with the correct escape characters.
> > 
> Thanks for the feedback. You're absolutely right that terminal alignment
> can get tricky, and ncurses does provide a more feature-complete way to
> handle interactive table layouts.
> 
> However, for this patch, the intent was much narrower — to make existing
> nvme-cli tabular output (e.g., nvme list, nvme list -v and nvme show-topology)
> more consistent and readable without requiring each command to manually set
> column/row widths. The current implementation just calculates the max width
> per column and pads with spaces, which works for the non-interactive, plain-text
> output we typically expect from CLI tools (including when the output is
> redirected to a file).

I agree with Nilay here. It might not be perfect solution but the
current code is producing non aligned tables (as the examples show).
And another good thing about this patch, it removes the formatting rules
from the printf statements and we only have to touch one place. After
that we could add optional ncurses support if someone fancy this to do.

Thanks,
Daniel


  reply	other threads:[~2025-08-20  9:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 12:56 [PATCHv2 0/4] nvme-cli: enhance the visibility of multipath using show-topology command Nilay Shroff
2025-08-12 12:56 ` [PATCHv2 1/4] nvme: support <device> option in " Nilay Shroff
2025-08-18  7:12   ` Hannes Reinecke
2025-08-19  4:43     ` Nilay Shroff
2025-08-19  6:11       ` Hannes Reinecke
2025-08-12 12:56 ` [PATCHv2 2/4] nvme: extend show-topology command to add support for multipath Nilay Shroff
2025-08-18  7:22   ` Hannes Reinecke
2025-08-19  4:49     ` Nilay Shroff
2025-08-19  6:15       ` Hannes Reinecke
2025-08-19 10:31         ` Nilay Shroff
2025-08-19 11:05           ` Hannes Reinecke
2025-08-19 11:30             ` Nilay Shroff
2025-08-20  8:17         ` Daniel Wagner
2025-08-20  8:30           ` Hannes Reinecke
2025-08-20 11:59             ` Nilay Shroff
2025-09-01  9:21               ` Nilay Shroff
2025-09-01 16:36                 ` Daniel Wagner
2025-09-02  6:26                   ` Hannes Reinecke
2025-09-03  4:22                     ` Nilay Shroff
2025-09-03  7:24                       ` Daniel Wagner
2025-09-03 12:19                         ` Nilay Shroff
2025-08-12 12:56 ` [PATCHv2 3/4] nvme: add common APIs for printing tabular format output Nilay Shroff
2025-08-18  7:27   ` Hannes Reinecke
2025-08-19  8:56     ` Nilay Shroff
2025-08-20  8:23       ` Daniel Wagner [this message]
2025-08-12 12:56 ` [PATCHv2 4/4] nvme: add support for printing show-topology in tabular form Nilay Shroff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ddf7e643-75ad-4878-bad3-11b60dfd95ec@flourine.local \
    --to=dwagner@suse.de \
    --cc=gjoyce@ibm.com \
    --cc=hare@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nilay@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.