From ca0c72b92070ed933bc0a29c7f767d892dd6f529 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 2690bcc..cf1a968 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)