Cleanup previous PR

This commit is contained in:
Kovid Goyal
2025-04-05 09:22:10 +05:30
parent 08eb0aca82
commit 38a2c6eab0
2 changed files with 5 additions and 7 deletions

View File

@@ -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)

View File

@@ -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()
}