From 33f6406a1eb979bb12f45218eb1592143c2099f0 Mon Sep 17 00:00:00 2001 From: bircni Date: Sun, 11 Oct 2026 23:48:34 +0200 Subject: [PATCH] refactor(auth): write piped auth status through writeTable The tab-separated status rows no longer use the terminal.Row shim; the expiry is a time cell, so piped output keeps RFC3339 timestamps. Signed-off-by: bircni --- internal/app/auth.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/app/auth.go b/internal/app/auth.go index 11f07372..d26ce5a8 100644 --- a/internal/app/auth.go +++ b/internal/app/auth.go @@ -561,18 +561,16 @@ func (a *application) environmentStatus(ctx context.Context, s settings.Snapshot func (a *application) writeAuthStatus(cmd *cobra.Command, rows []authStatusRow) error { d := a.display() if !d.TTY { - cells := make([][]terminal.Cell, len(rows)) - for i, row := range rows { - verified, expires := "", "" + return writeTable(a, cmd, rows, listSpec[authStatusRow]{Row: func(row authStatusRow) []terminal.Cell { + verified, expires := "", terminal.Cell{} if row.Verified != nil { verified = fmt.Sprint(*row.Verified) } if row.ExpiresAt != nil { - expires = terminal.Timestamp(*row.ExpiresAt) + expires.Time = *row.ExpiresAt } - cells[i] = terminal.Row(row.Host, row.User, fmt.Sprint(row.Active), row.Method, row.Store, fmt.Sprint(row.Available), verified, expires, row.Error) - } - return a.writeHuman(cmd, terminal.Table(nil, cells, d)) + return []terminal.Cell{{Text: row.Host}, {Text: row.User}, {Text: fmt.Sprint(row.Active)}, {Text: row.Method}, {Text: row.Store}, {Text: fmt.Sprint(row.Available)}, {Text: verified}, expires, {Text: row.Error}} + }}, listPage{Number: 1}) } byHost := map[string][]authStatusRow{} for _, row := range rows {