From 9b8baa82746d363268af709be5724e65cf82263b Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sun, 11 Aug 2024 11:26:52 -0700 Subject: [PATCH] Add more short column name alternatives similar to #228 --- client/lib/lib.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/lib/lib.go b/client/lib/lib.go index a2a323a..374d146 100644 --- a/client/lib/lib.go +++ b/client/lib/lib.go @@ -87,17 +87,17 @@ func BuildTableRow(ctx context.Context, columnNames []string, entry data.History row := make([]string, 0) for _, header := range columnNames { switch header { - case "Hostname", "hostname": + case "Hostname", "hostname", "hn": row = append(row, entry.Hostname) case "CWD", "cwd": row = append(row, entry.CurrentWorkingDirectory) - case "Timestamp", "timestamp": + case "Timestamp", "timestamp", "ts": if entry.StartTime.UnixMilli() == 0 { row = append(row, "N/A") } else { row = append(row, entry.StartTime.Local().Format(hctx.GetConf(ctx).TimestampFormat)) } - case "Runtime", "runtime": + case "Runtime", "runtime", "rt": if entry.EndTime.UnixMilli() == 0 { // An EndTime of zero means this is a pre-saved entry that never finished row = append(row, "N/A") @@ -106,7 +106,7 @@ func BuildTableRow(ctx context.Context, columnNames []string, entry data.History } case "Exit Code", "Exit_Code", "ExitCode", "exitcode", "$?", "EC": row = append(row, fmt.Sprintf("%d", entry.ExitCode)) - case "Command", "command": + case "Command", "command", "cmd": row = append(row, commandRenderer(entry.Command)) case "User", "user": row = append(row, entry.LocalUsername)