Skip to content
Myr

Allow sourcing zsh completion script (#1917)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Although it is not the recommended approach, sourcing a completion script is the simplest way to get people to try using shell completion. Not allowing it for zsh has turned out to complicate shell completion adoption. Further, many tools modify the zsh script to allow sourcing. This commit allows sourcing of the zsh completion script.

authored by Marc Khouzam · committed by GitHub · parent c8a20a1 · Browse files · 2 files+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>

Diff stats

2 files+2 added−1 removed

  • other:+2 added−1 removed

2 files+2 added−1 removed

modified:completions.go+1 added-1 removed
732 unmodified lines
733 echo "autoload -U compinit; compinit" >> ~/.zshrc734735To load completions in your current shell session:736737 source <(%[1]s completion zsh); compdef _%[1]s %[1]s737 source <(%[1]s completion zsh)738739To load completions for every new session, execute once:740741#### Linux:
137 unmodified lines
modified:zsh_completions.go+1 added
88 unmodified lines
89 if !includeDesc {90 compCmd = ShellCompNoDescRequestCmd91 }92 WriteStringAndCheck(buf, fmt.Sprintf(`#compdef %[1]s93compdef _%[1]s %[1]s9495# zsh completion for %-36[1]s -*- shell-script -*-9697__%[1]s_debug()
211 unmodified lines