mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 08:45:30 +03:00
Merge pull request #805 from MichaelMure/completion-cleanup
misc: move all completions in a dedicated folder
This commit is contained in:
commit
d94df63466
8
.gitignore
vendored
8
.gitignore
vendored
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user