aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/gen_zsh_completion.go21
-rw-r--r--doc/zsh_completion/git-bug20
2 files changed, 41 insertions, 0 deletions
diff --git a/doc/gen_zsh_completion.go b/doc/gen_zsh_completion.go
new file mode 100644
index 00000000..319805fd
--- /dev/null
+++ b/doc/gen_zsh_completion.go
@@ -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)
+ }
+}
diff --git a/doc/zsh_completion/git-bug b/doc/zsh_completion/git-bug
new file mode 100644
index 00000000..ce85f435
--- /dev/null
+++ b/doc/zsh_completion/git-bug
@@ -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