From f1449bfe5c7255d7b1d168540f7756fb1e73560d Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 15 Mar 2022 11:51:54 -0400 Subject: [PATCH] main: Add -debug flag for enabling debugger support (#27) Reference: https://github.com/hashicorp/terraform-provider-scaffolding-framework/issues/8 --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index ffc40fb..b00e276 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "flag" "log" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -28,7 +29,14 @@ var ( ) 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() + opts := tfsdk.ServeOpts{ + Debug: debug, + // TODO: Update this string with the published name of your provider. Name: "registry.terraform.io/hashicorp/scaffolding", }