mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Cleanup previous PR
This commit is contained in:
@@ -4,7 +4,7 @@ package cli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kitty/tools/cli/markup"
|
"kitty/tools/cli/markup"
|
||||||
@@ -23,7 +23,6 @@ func fish_completion_script(commands []string) (string, error) {
|
|||||||
}
|
}
|
||||||
if len(commands) == 0 {
|
if len(commands) == 0 {
|
||||||
commands = append(commands, utils.Keys(all_commands)...)
|
commands = append(commands, utils.Keys(all_commands)...)
|
||||||
sort.Strings(commands)
|
|
||||||
}
|
}
|
||||||
script := strings.Builder{}
|
script := strings.Builder{}
|
||||||
script.WriteString(`function __ksi_completions
|
script.WriteString(`function __ksi_completions
|
||||||
@@ -33,6 +32,7 @@ func fish_completion_script(commands []string) (string, error) {
|
|||||||
end
|
end
|
||||||
|
|
||||||
`)
|
`)
|
||||||
|
slices.Sort(commands)
|
||||||
for _, cmd := range commands {
|
for _, cmd := range commands {
|
||||||
if all_commands[cmd] {
|
if all_commands[cmd] {
|
||||||
fmt.Fprintf(&script, "complete -f -c %s -a \"(__ksi_completions)\"\n", cmd)
|
fmt.Fprintf(&script, "complete -f -c %s -a \"(__ksi_completions)\"\n", cmd)
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
@@ -137,11 +137,9 @@ func ShowHelpInPager(text string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getDeterministicTimestamp() time.Time {
|
func getDeterministicTimestamp() time.Time {
|
||||||
if epochStr, exists := os.LookupEnv("SOURCE_DATE_EPOCH"); exists {
|
if epoch, err := strconv.ParseInt(os.Getenv("SOURCE_DATE_EPOCH"), 10, 64); err == nil {
|
||||||
if epoch, err := strconv.ParseInt(epochStr, 10, 64); err == nil {
|
|
||||||
return time.Unix(epoch, 0).UTC()
|
return time.Unix(epoch, 0).UTC()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return time.Now()
|
return time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user