aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-06-28 18:26:29 +0200
committerMichael Muré <batolettre@gmail.com>2020-06-28 18:26:29 +0200
commit26bd1dd11010b4d86cebe2510ad7085a6b316334 (patch)
treef1fe939311c75bd615071e96f3d37822cccd77a7 /misc
parentc0dbc149d5c0c3610476ba14a800c9ba803a2c2c (diff)
downloadgit-bug-26bd1dd11010b4d86cebe2510ad7085a6b316334.tar.gz
commands: refactor to avoid globals
Diffstat (limited to 'misc')
-rw-r--r--misc/gen_completion.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/gen_completion.go b/misc/gen_completion.go
index 0ebb5eeb..80b89902 100644
--- a/misc/gen_completion.go
+++ b/misc/gen_completion.go
@@ -39,23 +39,23 @@ func main() {
func genBash() error {
cwd, _ := os.Getwd()
dir := path.Join(cwd, "misc", "bash_completion", "git-bug")
- return commands.RootCmd.GenBashCompletionFile(dir)
+ return commands.NewRootCommand().GenBashCompletionFile(dir)
}
func genFish() error {
cwd, _ := os.Getwd()
dir := path.Join(cwd, "misc", "fish_completion", "git-bug")
- return commands.RootCmd.GenFishCompletionFile(dir, true)
+ return commands.NewRootCommand().GenFishCompletionFile(dir, true)
}
func genPowerShell() error {
cwd, _ := os.Getwd()
filepath := path.Join(cwd, "misc", "powershell_completion", "git-bug")
- return commands.RootCmd.GenPowerShellCompletionFile(filepath)
+ return commands.NewRootCommand().GenPowerShellCompletionFile(filepath)
}
func genZsh() error {
cwd, _ := os.Getwd()
filepath := path.Join(cwd, "misc", "zsh_completion", "git-bug")
- return commands.RootCmd.GenZshCompletionFile(filepath)
+ return commands.NewRootCommand().GenZshCompletionFile(filepath)
}