From 5f7a48ee8e44b412295542b3b4a2bb1c253e3568 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 29 Mar 2026 23:12:16 +0100 Subject: [PATCH] skip pre run hook for completion/help commands --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 655d905..0021837 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,11 @@ It allows users to easily create and manage .gitignore files for various program You may also list available templates and generate .gitignore files based on those templates.`, SilenceUsage: true, PersistentPreRun: func(cmd *cobra.Command, _ []string) { + if strings.HasPrefix(cmd.CommandPath(), "exclude completion") || + strings.HasPrefix(cmd.CommandPath(), "exclude help") { + return + } + var client *github.Client if !viper.IsSet("token") || viper.GetString("token") == "" { client = github.NewClient(nil)