Skip to content

Commit ca79936

Browse files
committed
[docs] Add bash and zsh completion files
1 parent 7f5c1da commit ca79936

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

coconut/doc/generate.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,19 @@ func main() {
5959
log.Fatal(err)
6060
}
6161

62+
// Generate bash completion file
63+
const bashCompletionPath = "../../share/bash-completion/completions"
64+
_ = os.MkdirAll(bashCompletionPath, 0755)
65+
err = rootCmd.GenBashCompletionFileV2(bashCompletionPath+"/coconut.sh", true)
66+
if err != nil {
67+
log.Fatal(err)
68+
}
69+
70+
const zshCompletionPath = "../../share/zsh/site-functions"
71+
_ = os.MkdirAll(zshCompletionPath, 0755)
72+
err = rootCmd.GenZshCompletionFile(bashCompletionPath + "/_coconut")
73+
if err != nil {
74+
log.Fatal(err)
75+
}
76+
6277
}

0 commit comments

Comments
 (0)