mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
bash completion: thanks to @tst2005, make the completion works for "git bug <command>"
This commit is contained in:
parent
b8e9e581b1
commit
929d709364
@ -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() {
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user