mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 08:45:30 +03:00
generate zsh completion
This commit is contained in:
parent
302a69bfc5
commit
35240350ea
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
git-bug
|
||||
!/doc/bash_completion/git-bug
|
||||
!/doc/zsh_completion/git-bug
|
||||
|
21
doc/gen_zsh_completion.go
Normal file
21
doc/gen_zsh_completion.go
Normal file
@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/MichaelMure/git-bug/commands"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cwd, _ := os.Getwd()
|
||||
filepath := path.Join(cwd, "doc", "zsh_completion", "git-bug")
|
||||
|
||||
fmt.Println("Generating zsh completion file ...")
|
||||
|
||||
err := commands.RootCmd.GenZshCompletionFile(filepath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
20
doc/zsh_completion/git-bug
Normal file
20
doc/zsh_completion/git-bug
Normal file
@ -0,0 +1,20 @@
|
||||
#compdef git-bug
|
||||
|
||||
_arguments \
|
||||
'1: :->level1' \
|
||||
'2: :_files'
|
||||
case $state in
|
||||
level1)
|
||||
case $words[1] in
|
||||
git-bug)
|
||||
_arguments '1: :(close commands comment label ls new open pull push show webui)'
|
||||
;;
|
||||
*)
|
||||
_arguments '*: :_files'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
_arguments '*: :_files'
|
||||
;;
|
||||
esac
|
@ -2,6 +2,7 @@
|
||||
//go:generate go run doc/gen_markdown.go
|
||||
//go:generate go run doc/gen_manpage.go
|
||||
//go:generate go run doc/gen_bash_completion.go
|
||||
//go:generate go run doc/gen_zsh_completion.go
|
||||
|
||||
package main
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user