From 38a2c6eab0b5ebf0f4fb464cc04a73cdf8a98da8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Apr 2025 09:22:10 +0530 Subject: [PATCH] Cleanup previous PR --- tools/cli/fish.go | 4 ++-- tools/cli/help.go | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/cli/fish.go b/tools/cli/fish.go index d6fd8179e..1f78e832f 100644 --- a/tools/cli/fish.go +++ b/tools/cli/fish.go @@ -4,7 +4,7 @@ package cli import ( "fmt" - "sort" + "slices" "strings" "kitty/tools/cli/markup" @@ -23,7 +23,6 @@ func fish_completion_script(commands []string) (string, error) { } if len(commands) == 0 { commands = append(commands, utils.Keys(all_commands)...) - sort.Strings(commands) } script := strings.Builder{} script.WriteString(`function __ksi_completions @@ -33,6 +32,7 @@ func fish_completion_script(commands []string) (string, error) { end `) + slices.Sort(commands) for _, cmd := range commands { if all_commands[cmd] { fmt.Fprintf(&script, "complete -f -c %s -a \"(__ksi_completions)\"\n", cmd) diff --git a/tools/cli/help.go b/tools/cli/help.go index 035259322..3b263d0fd 100644 --- a/tools/cli/help.go +++ b/tools/cli/help.go @@ -8,8 +8,8 @@ import ( "os" "os/exec" "slices" - "strings" "strconv" + "strings" "time" "golang.org/x/sys/unix" @@ -137,10 +137,8 @@ func ShowHelpInPager(text string) { } func getDeterministicTimestamp() time.Time { - if epochStr, exists := os.LookupEnv("SOURCE_DATE_EPOCH"); exists { - if epoch, err := strconv.ParseInt(epochStr, 10, 64); err == nil { - return time.Unix(epoch, 0).UTC() - } + if epoch, err := strconv.ParseInt(os.Getenv("SOURCE_DATE_EPOCH"), 10, 64); err == nil { + return time.Unix(epoch, 0).UTC() } return time.Now() }