Skip to content

Commit

Permalink
[docs] Add bash and zsh completion files
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Aug 18, 2023
1 parent 7f5c1da commit ca79936
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions coconut/doc/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,19 @@ func main() {
log.Fatal(err)
}

// Generate bash completion file
const bashCompletionPath = "../../share/bash-completion/completions"
_ = os.MkdirAll(bashCompletionPath, 0755)
err = rootCmd.GenBashCompletionFileV2(bashCompletionPath+"/coconut.sh", true)
if err != nil {
log.Fatal(err)
}

const zshCompletionPath = "../../share/zsh/site-functions"
_ = os.MkdirAll(zshCompletionPath, 0755)
err = rootCmd.GenZshCompletionFile(bashCompletionPath + "/_coconut")
if err != nil {
log.Fatal(err)
}

}

0 comments on commit ca79936

Please sign in to comment.