Skip to content

Print ls and ls-remote as tables with column headings - #3

Merged
nahime0 merged 1 commit into
mainfrom
table-output
Sep 1, 2026
Merged

nahime0 merged 1 commit into
mainfrom
table-output

Conversation

@nahime0

@nahime0 nahime0 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The listings had grown three kinds of line — headings, prose and data — all at the same weight and indent, so a hint read as another entry and the sections ran together. The worst of it was no binary for this platform repeated on eight consecutive lines, saying the same thing each time and filling half the screen.

Before

nightly — unsupported builds of main
  elvm install nightly takes the newest, a dated tag pins one
    nightly-20260901  0.26.5-nightly.20260901+gfa49dafde

releases — 121 in 20 series, 10 older hidden
  elvm ls-remote --all lists every patch
    0.17.9   (+9)   no binary for this platform
    0.18.5   (+5)   no binary for this platform
    0.19.14  (+14)  no binary for this platform
    ...
    0.25.2   (+2)

    0.26.0
    0.26.5          ← latest

After

1 unsupported nightly build of main — elvm install nightly takes the newest
NIGHTLY           BUILD                               PUBLISHED   NOTE
nightly-20260901  0.26.5-nightly.20260901+gfa49dafde  2026-09-01  installed

121 releases in 20 series, 10 older hidden — elvm ls-remote --all for every patch
VERSION  OLDER  BINARY  NOTE
0.17.9   +9     no
0.25.2   +2     yes
0.26.0          yes
0.26.5          yes     latest, installed

What the heading row buys

A heading names what a column holds, which is what lets the rows stop repeating sentences: that eight-line note is a BINARY column three characters wide. The * marker is gone the same way — "installed", "latest" and "active" are words in a NOTE column instead of a symbol to decode.

A column no row fills is dropped, heading and all: ls-remote --all collapses no series, so it shows no OLDER column rather than a heading over blanks. In ls, BUILD and PUBLISHED appear only when a nightly is installed, since a release is fully identified by its name. Every line is right-trimmed, so an empty trailing column leaves nothing behind.

The blank line that used to split the release list is gone too. It separated collapsed series from the expanded one, a distinction OLDER now states outright, so it had become a gap with no meaning.

Two consequences worth naming

  • The "build from source" hint went missing with the note it used to trail. It is back as a single line, printed only when BINARY reads no on every row — the one case where the fix is not "install a different version".
  • group's expanded flag is no longer read outside the tests, since the table renders collapsed and expanded rows alike. It stays, marked, because it is the only thing that separates a collapsed single-patch series from an individually listed release (older_in_series is 0 for both), and dropping it would weaken the grouping tests.

Ordering is no longer load-bearing: the newest release had to be the last line on screen because nothing else identified it, and its row now says latest. So the nightly table sits on top, where it reads best.

Tests

Display assertions were rewritten to read a row rather than an exact substring, since column padding depends on what else is on screen. Adds a test for ls, whose "incomplete" note had never had one, and unit tests for the shared table module (heading widths, dropped columns, trailing whitespace, multi-byte names).

53 unit + 46 integration tests, fmt and clippy clean. Output verified against the real GitHub API, not only mocks.

The listings had grown three kinds of line — headings, prose and data —
all at the same weight and indent, so a hint read as another entry and
the sections ran together. The worst of it was "no binary for this
platform" repeated on eight consecutive lines, saying the same thing
each time and filling half the screen.

Both commands now print a table with a heading row, through a shared
`table` module. A heading names what a column holds, which is what lets
the rows stop repeating sentences: that eight-line note is a BINARY
column three characters wide. The `*` marker is gone the same way —
"installed", "latest" and "active" are words in a NOTE column instead of
a symbol to decode.

A column no row fills is dropped, heading and all: `ls-remote --all`
collapses no series, so it shows no OLDER column rather than a heading
over blanks. In `ls`, BUILD and PUBLISHED appear only when a nightly is
installed, since a release is fully identified by its name. Every line
is right-trimmed, so an empty trailing column leaves nothing behind.

The blank line that used to split the release list is gone too. It
separated collapsed series from the expanded one, a distinction OLDER
now states outright, so it had become a gap with no meaning.

Two consequences worth naming:

  * the "build from source" hint went missing with the note it used to
    trail. It is back as a single line, printed only when BINARY reads
    `no` on every row — the one case where the fix is not "install a
    different version".
  * `group`'s `expanded` flag is no longer read outside the tests, since
    the table renders collapsed and expanded rows alike. It stays,
    marked, because it is the only thing that separates a collapsed
    single-patch series from an individually listed release —
    `older_in_series` is 0 for both — and dropping it would weaken the
    grouping tests.

Ordering is no longer load-bearing: the newest release had to be the
last line on screen because nothing else identified it, and its row now
says `latest`. So the nightly table sits on top, where it reads best.

Display assertions were rewritten to read a row rather than an exact
substring, since column padding depends on what else is on screen. Adds
a test for `ls`, whose "incomplete" note had never had one.
@nahime0
nahime0 merged commit 59fca10 into main Sep 1, 2026
2 checks passed
@nahime0
nahime0 deleted the table-output branch September 1, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant