mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 16:41:30 +00:00
29 lines
573 B
Go
29 lines
573 B
Go
//go:build generate && generate_completions
|
|
|
|
package main
|
|
|
|
import "github.com/sagernet/sing-box/log"
|
|
|
|
func main() {
|
|
err := generateCompletions()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func generateCompletions() error {
|
|
err := mainCommand.GenBashCompletionFile("release/completions/sing-box.bash")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = mainCommand.GenFishCompletionFile("release/completions/sing-box.fish", true)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = mainCommand.GenZshCompletionFile("release/completions/sing-box.zsh")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|