unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Vollmert <rob@vllmrt.net>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel@gnu.org
Subject: Re: small hack to prettify output of list-installed
Date: Fri, 19 Jul 2019 18:21:55 +0200	[thread overview]
Message-ID: <A35F95D0-606C-4C1F-BBA3-4F87B5EC4860@vllmrt.net> (raw)
In-Reply-To: <20190719103258.61378b09@scratchpost.org>

Hi Danny,

I don’t particularly care about this interface improvement making
it in, I’m ok with leaving things as they are. I do however feel
that some of the points made against deserve a reply.

On 19. Jul 2019, at 10:32, Danny Milosavljevic <dannym@scratchpost.org> wrote:
> On Fri, 19 Jul 2019 09:46:15 +0200
> Robert Vollmert <rob@vllmrt.net> wrote:
> 
>> here’s a small patch that calls “column -t” on the output of
>> `guix package --list-installed`. Probably not suitable for
>> inclusion since I assume the guix scripts shouldn’t depend
>> on `util-linux`, but I find it quite nice to have, so maybe
>> it’s useful to someone else.
> 
> For better or for worse we are on UNIX.  UNIX works best if programs
> don't do weird special-processing like that by default - in order
> not to break whatever pipe processing the user adds (IMO we do
> way too much processing on our own already).
> 
> The user can always do
> 
>    guix ... | column -t
> 
> in a shell (or a guix wrapper shell script), right?

Writing a shell script is tricky because that would involve argument
parsing. This shouldn’t apply to all guix subcommands, or even the
whole of “guix package”.

I can tell you how the “guix … | column -t” suggestion works out at best:
Users run “guix --list-installed”, see that the output is a mess, and run
it a second time, piping it into “column -t”. Then two weeks later, when
they do some package management things again, they go through the same
process again.

Hmm. What do you think about patching /bin/ls to not offer columnized
output, to encourage users to learn about /bin/column and friends?

> Moreover (and I can't believe I'm still arguing that), terminals have the
> ability to set tab stops and there's no reason why the user wouldn't set
> up tab stops.  Then this entire thing would be counterproductive.
> 
> I know, in practise almost nobody sets those up, but it's some strange NIH
> stuff not to use those.  They are there, they are not broken, and they are
> in order to make tables.
> 
> To set those up, use the "tabs" program.
> 
> $ tabs 1 10 50
> $ echo -e 'hello\tbu\tba'
> hello    bu                                      ba

That’s an interesting bit of shell / terminal knowledge, thanks for sharing!

Cheers
Robert

  reply	other threads:[~2019-07-19 16:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19  7:46 small hack to prettify output of list-installed Robert Vollmert
2019-07-19  8:32 ` Danny Milosavljevic
2019-07-19 16:21   ` Robert Vollmert [this message]
2019-07-22 14:25     ` Danny Milosavljevic

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=A35F95D0-606C-4C1F-BBA3-4F87B5EC4860@vllmrt.net \
    --to=rob@vllmrt.net \
    --cc=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).