package main import ( "context" "log" "os" "os/signal" "github.com/spf13/cobra" "code.icb4dc0.de/prskr/nitter/internal/commands" ) var root = &cobra.Command{ Use: "nitter", TraverseChildren: true, } func main() { root.PersistentFlags().StringP("namespace", "n", "", "Namespace a.k.a. organization/owner/group of the repository [$NITTER_NAMESPACE]") root.PersistentFlags().StringP("repo", "r", "", "Repo to interact with [$NITTER_REPO]") root.PersistentFlags().StringP("result-file", "f", "", "path to the golangci-lint JSON output [$NITTER_RESULT_FILE]") ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) defer cancel() root.AddCommand(commands.Gitea()) if err := root.ExecuteContext(ctx); err != nil { log.Fatal(err) } }