From 5cfc8bd701037a215c62789916cda283a018d3fd Mon Sep 17 00:00:00 2001 From: ewy Date: Sun, 17 May 2026 02:13:25 +0200 Subject: add priority to version and completion to reduce start times for those modes --- completion/completion.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'completion/completion.go') diff --git a/completion/completion.go b/completion/completion.go index 641eb8a..9d3ae72 100644 --- a/completion/completion.go +++ b/completion/completion.go @@ -31,8 +31,10 @@ var completionFileByShell = map[string]string{ "zsh": ".zshrc", } +// AlreadyInstalledError is returned when we already found completion code in your shell rc file var AlreadyInstalledError = errors.New("completion already installed") +// Add finds the right file to append the completion code to and does that func Add(shell string) error { f := filepath.Join(paths.HomeDir.String(), completionFileByShell[shell]) content, err := os.ReadFile(f) @@ -59,6 +61,8 @@ func successMessage(shell string, file string) { _, _ = spool.Print("Installed completion for %s in %s\n", shell, file) } +// Echo prints the actual completion script +// because it is baked in with the program it should always be version-appropriate func Echo() error { _, err := spool.Print("%s", completionCode) return err -- cgit v1.3.1