From 6c25a4239f9822c700b2cfa97a887d40aa16c8af Mon Sep 17 00:00:00 2001 From: William Park Date: Thu, 19 Oct 2023 11:37:20 -0700 Subject: [PATCH] Add ProviderAddr and Debug to plugin.Serve for debugging support --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 83a6cd92..7f409c55 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "github.com/1Password/terraform-provider-onepassword/onepassword" "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" ) @@ -16,7 +17,14 @@ import ( //go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs func main() { + var debug bool + + flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve") + flag.Parse() + plugin.Serve(&plugin.ServeOpts{ ProviderFunc: onepassword.Provider, + ProviderAddr: "1Password/onepassword", + Debug: debug, }) }