blob: 3a75b0f506794e4192d3d589b243457df3ac7562 (
plain) (
blame)
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
35
36
37
38
39
|
// +build ignore
package main
import (
"fmt"
"github.com/MichaelMure/git-bug/commands"
"log"
"os"
"path"
)
func main() {
cwd, _ := os.Getwd()
filepath := path.Join(cwd, "misc", "bash_completion", "git-bug")
fmt.Println("Generating bash completion file ...")
//git := &cobra.Command{
// Use: "git",
// BashCompletionFunction: "qsdhjlkqsdhlsd",
//}
//
//bug := &cobra.Command{
// Use: "bug",
// BashCompletionFunction: "ZHZLDHKLZDHJKL",
//}
//git.AddCommand(bug)
//for _, sub := range commands.RootCmd.Commands() {
// bug.AddCommand(sub)
//}
//err := git.GenBashCompletionFile(filepath)
err := commands.RootCmd.GenBashCompletionFile(filepath)
if err != nil {
log.Fatal(err)
}
}
|