From: Roel Janssen <roel@gnu.org>
To: Steve Sprang <steve.sprang@gmail.com>
Cc: 30053@debbugs.gnu.org
Subject: [bug#30053] [PATCH 1/3] Improve appearance of tabular output.
Date: Fri, 12 Jan 2018 14:28:30 +0100 [thread overview]
Message-ID: <87fu7b2old.fsf@gnu.org> (raw)
In-Reply-To: <CA+xn8YDjApPwzx_1kR2pTuwVAyajXO+n5KN27WCGNAF2eX+rDg@mail.gmail.com>
Steve Sprang writes:
> Hi Ludovic,
>
> On Thu, Jan 11, 2018 at 1:32 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> Long time no see! ;-)
>
> Yeah, it's been a while!
>
>> I have a disappointing explanation I’m afraid: the reason columns look
>> this way is because they are tab-separated, which in turn makes it easy
>> to filter with ‘cut’:
>>
>> --8<---------------cut here---------------start------------->8---
>> $ guix package -A | cut -f1 | head
>> 0ad
>> 0ad-data
>> 0xffff
>> 4store
>> 4ti2
>> a2ps
>> aalib
>> abbaye
>> abc
>> abcde
>> --8<---------------cut here---------------end--------------->8---
>
> I'm still inserting a tab between columns, so I believe 'cut' still
> works as expected in this case. Initially, I was separating columns
> with a few spaces, but that broke some of the tests that were relying
> on cut, so I switched back to tab.
>
>> An example from the manual (info "(guix) Invoking guix build"):
>>
>> guix build --quiet --keep-going \
>> `guix package -A | cut -f1,2 --output-delimiter=@`
>
> Argh, this use case fails because of the extra inserted whitespace.
>
>> The idea was to have this shell-scripting-friendly format, and to
>> provide fancier output in other commands, such as --search (which is in
>> fact script-friendly as well thanks to recutils).
>>
>> Silly? Awesome? Ugly? What do people think? :-)
>
> Another potential drawback of this patch is that it tends to make
> output lines longer than before. This might make line-wrapping less
> pleasant when using smaller terminal windows/screens.
>
> -Steve
If we use GNU awk instead of cut, I think any whitespace will work:
$ guix package -A | awk '{ print $1 "@" $2 }'
And then we can optimize the output reading experience for our users
instead of for the 'cut' program.
Kind regards,
Roel Janssen
next prev parent reply other threads:[~2018-01-12 13:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 22:34 [bug#30053] [PATCH 1/3] Improve appearance of tabular output Steve Sprang
2018-01-09 22:37 ` [bug#30053] [PATCH 2/3] " Steve Sprang
2018-01-09 22:37 ` [bug#30053] [PATCH 3/3] " Steve Sprang
2018-01-11 21:32 ` [bug#30053] [PATCH 1/3] " Ludovic Courtès
2018-01-11 23:32 ` Steve Sprang
2018-01-12 13:28 ` Roel Janssen [this message]
2018-01-13 19:59 ` Steve Sprang
2018-01-16 14:16 ` Ludovic Courtès
2018-01-16 23:56 ` Steve Sprang
2021-07-15 5:39 ` Maxim Cournoyer
2021-07-15 17:36 ` [bug#30053] [PATCH 1/3 v2] " Maxim Cournoyer
2021-07-15 20:15 ` bug#30053: [PATCH 1/3] " Maxim Cournoyer
2021-07-21 16:56 ` [bug#30053] " Ludovic Courtès
2021-07-21 21:43 ` Maxim Cournoyer
2021-07-15 22:05 ` Sarah Morgensen via Guix-patches via
2021-07-16 1:25 ` Maxim Cournoyer
2018-01-12 14:56 ` Danny Milosavljevic
2018-01-12 15:26 ` Leo Famulari
2018-01-12 15:50 ` bug#30087: "guix package -A" hangs with attached package set Danny Milosavljevic
2020-12-03 0:10 ` zimoun
2020-12-22 16:12 ` zimoun
2021-01-11 12:29 ` zimoun
2018-01-13 13:47 ` [bug#30053] [PATCH 1/3] Improve appearance of tabular output Ludovic Courtès
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=87fu7b2old.fsf@gnu.org \
--to=roel@gnu.org \
--cc=30053@debbugs.gnu.org \
--cc=steve.sprang@gmail.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
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.