aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-05-31 19:44:53 +0200
committerMichael Muré <batolettre@gmail.com>2022-05-31 19:44:53 +0200
commitc732a18ac2b6ea3d09e5c72660ffcf9687ebb9db (patch)
tree8c8eedcf02c5a86222c62b16ccb8e27fd6b464b0
parent650c11dcb68bfe00e2d399c5e1d337cae9c1bfeb (diff)
downloadgit-bug-c732a18ac2b6ea3d09e5c72660ffcf9687ebb9db.tar.gz
misc: move all completions in a dedicated folder
-rw-r--r--.gitignore8
-rw-r--r--README.md4
-rw-r--r--git-bug.go2
-rw-r--r--misc/completion/bash/git-bug (renamed from misc/bash_completion/git-bug)2
-rw-r--r--misc/completion/fish/git-bug (renamed from misc/fish_completion/git-bug)0
-rw-r--r--misc/completion/gen_completion.go (renamed from misc/gen_completion.go)10
-rw-r--r--misc/completion/powershell/git-bug (renamed from misc/powershell_completion/git-bug)0
-rw-r--r--misc/completion/zsh/git-bug (renamed from misc/zsh_completion/git-bug)0
8 files changed, 14 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index be1fc3f1..c61d1233 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
git-bug
-!/misc/bash_completion/git-bug
-!/misc/fish_completion/git-bug
-!/misc/powershell_completion/git-bug
-!/misc/zsh_completion/git-bug
+!/misc/completion/bash/git-bug
+!/misc/completion/fish/git-bug
+!/misc/completion/powershell/git-bug
+!/misc/completion/zsh/git-bug
.gitkeep
dist
coverage.txt
diff --git a/README.md b/README.md
index 8c51d6d5..323e4391 100644
--- a/README.md
+++ b/README.md
@@ -272,9 +272,7 @@ Interested by how it works ? Have a look at the [data model](doc/model.md) and t
## Misc
-- [Bash completion](misc/bash_completion)
-- [Zsh completion](misc/zsh_completion)
-- [PowerShell completion](misc/powershell_completion)
+- [Bash, Zsh, fish, powershell completion](misc/completion)
- [ManPages](doc/man)
## Planned features
diff --git a/git-bug.go b/git-bug.go
index 995fc559..99fe81c5 100644
--- a/git-bug.go
+++ b/git-bug.go
@@ -1,5 +1,5 @@
//go:generate go run doc/gen_docs.go
-//go:generate go run misc/gen_completion.go
+//go:generate go run misc/completion/gen_completion.go
package main
diff --git a/misc/bash_completion/git-bug b/misc/completion/bash/git-bug
index 85d2a15b..92b90d3c 100644
--- a/misc/bash_completion/git-bug
+++ b/misc/completion/bash/git-bug
@@ -287,6 +287,8 @@ fi
# ex: ts=4 sw=4 et filetype=sh
+# Custom bash code to connect the git completion for "git bug" to the
+# git-bug completion for "git-bug"
_git_bug() {
local cur prev words cword split
diff --git a/misc/fish_completion/git-bug b/misc/completion/fish/git-bug
index a3c2d008..a3c2d008 100644
--- a/misc/fish_completion/git-bug
+++ b/misc/completion/fish/git-bug
diff --git a/misc/gen_completion.go b/misc/completion/gen_completion.go
index 1f86124d..5f643832 100644
--- a/misc/gen_completion.go
+++ b/misc/completion/gen_completion.go
@@ -44,13 +44,15 @@ func genBash(root *cobra.Command) error {
if err != nil {
return err
}
- f, err := os.Create(filepath.Join(cwd, "misc", "bash_completion", "git-bug"))
+ f, err := os.Create(filepath.Join(cwd, "misc", "completion", "bash", "git-bug"))
if err != nil {
return err
}
defer f.Close()
const patch = `
+# Custom bash code to connect the git completion for "git bug" to the
+# git-bug completion for "git-bug"
_git_bug() {
local cur prev words cword split
@@ -102,7 +104,7 @@ func genFish(root *cobra.Command) error {
if err != nil {
return err
}
- dir := filepath.Join(cwd, "misc", "fish_completion", "git-bug")
+ dir := filepath.Join(cwd, "misc", "completion", "fish", "git-bug")
return root.GenFishCompletionFile(dir, true)
}
@@ -111,7 +113,7 @@ func genPowerShell(root *cobra.Command) error {
if err != nil {
return err
}
- path := filepath.Join(cwd, "misc", "powershell_completion", "git-bug")
+ path := filepath.Join(cwd, "misc", "completion", "powershell", "git-bug")
return root.GenPowerShellCompletionFile(path)
}
@@ -120,6 +122,6 @@ func genZsh(root *cobra.Command) error {
if err != nil {
return err
}
- path := filepath.Join(cwd, "misc", "zsh_completion", "git-bug")
+ path := filepath.Join(cwd, "misc", "completion", "zsh", "git-bug")
return root.GenZshCompletionFile(path)
}
diff --git a/misc/powershell_completion/git-bug b/misc/completion/powershell/git-bug
index b8280eea..b8280eea 100644
--- a/misc/powershell_completion/git-bug
+++ b/misc/completion/powershell/git-bug
diff --git a/misc/zsh_completion/git-bug b/misc/completion/zsh/git-bug
index e7cbe9a9..e7cbe9a9 100644
--- a/misc/zsh_completion/git-bug
+++ b/misc/completion/zsh/git-bug