From 26e7ce44db91f3b08fa5d1b32690348d40c1fb00 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 6 Aug 2018 03:22:36 +0200 Subject: upgrade the readme --- misc/gen_bash_completion.go | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 misc/gen_bash_completion.go (limited to 'misc/gen_bash_completion.go') diff --git a/misc/gen_bash_completion.go b/misc/gen_bash_completion.go new file mode 100644 index 00000000..3a75b0f5 --- /dev/null +++ b/misc/gen_bash_completion.go @@ -0,0 +1,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) + } +} -- cgit