[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: small hack to prettify output of list-installed
From: |
Robert Vollmert |
Subject: |
Re: small hack to prettify output of list-installed |
Date: |
Fri, 19 Jul 2019 18:21:55 +0200 |
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 <address@hidden> wrote:
> On Fri, 19 Jul 2019 09:46:15 +0200
> Robert Vollmert <address@hidden> 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