mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Cleanup previous PR
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user