diff options
-rw-r--r-- | commands/root.go | 6 | ||||
-rw-r--r-- | misc/bash_completion/git-bug | 5 | ||||
-rw-r--r-- | misc/gen_bash_completion.go | 16 |
3 files changed, 11 insertions, 16 deletions
diff --git a/commands/root.go b/commands/root.go index be258199..67f05ebf 100644 --- a/commands/root.go +++ b/commands/root.go @@ -35,6 +35,12 @@ It use the same internal storage so it doesn't pollute your project. As you woul PersistentPreRunE: loadRepo, DisableAutoGenTag: true, + + BashCompletionFunction: ` +_git_bug() { + __start_git-bug "$@" +} +`, } func Execute() { diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug index d8505868..bc831998 100644 --- a/misc/bash_completion/git-bug +++ b/misc/bash_completion/git-bug @@ -243,6 +243,11 @@ __git-bug_handle_word() __git-bug_handle_word } + +_git_bug() { + __start_git-bug "$@" +} + _git-bug_close() { last_command="git-bug_close" diff --git a/misc/gen_bash_completion.go b/misc/gen_bash_completion.go index 3a75b0f5..8793556a 100644 --- a/misc/gen_bash_completion.go +++ b/misc/gen_bash_completion.go @@ -16,22 +16,6 @@ func main() { 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) |