-
Notifications
You must be signed in to change notification settings - Fork 5
/
completion.go
34 lines (28 loc) · 963 Bytes
/
completion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
"github.com/spf13/cobra"
)
// completionCmd represents the completion command
var completionCmd = &cobra.Command{
Use: "completion",
Short: "completion自动命令补全工具",
Long: `生成bash | zsh 的代码自动补全脚本
配置方法在~/.zshrc or ~/.bashrc中配置:
source <(showme completion zsh)`,
// Run: func(cmd *cobra.Command, args []string) {
// fmt.Println("completion called")
// },
}
func init() {
rootCmd.AddCommand(completionCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// completionCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// completionCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}