From 26bd1dd11010b4d86cebe2510ad7085a6b316334 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 28 Jun 2020 18:26:29 +0200 Subject: commands: refactor to avoid globals --- misc/gen_completion.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'misc') 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) } -- cgit