Skip to content
Myr

adding a GenZshCompletionFile function to mirror bash_completion (#529)

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

authored by agmen · committed by Eric Paris · parent 3c0b56b · Browse files · 1 file+12 added−0 removed
This commit

State

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

Diff stats

1 file+12 added−0 removed

  • other:+12 added−0 removed

1 file+12 added−0 removed

modified:zsh_completions.go+12 added
2 unmodified lines
3import (4 "bytes"5 "fmt"6 "io"7 "os"8 "strings"9)1011// GenZshCompletionFile generates zsh completion file.12func (cmd *Command) GenZshCompletionFile(filename string) error {13 outFile, err := os.Create(filename)14 if err != nil {15 return err16 }17 defer outFile.Close()1819 return cmd.GenZshCompletion(outFile)20}2122// GenZshCompletion generates a zsh completion file and writes to the passed writer.23func (cmd *Command) GenZshCompletion(w io.Writer) error {24 buf := new(bytes.Buffer)25
101 unmodified lines