Skip to content

Commit

Permalink
Adding support for debug flag (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed Jun 28, 2022
1 parent 6c94c96 commit c75de56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"flag"
"log"

"github.com/hashicorp/terraform-plugin-framework/providerserver"
Expand All @@ -20,8 +21,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()

err := providerserver.Serve(context.Background(), provider.New, providerserver.ServeOpts{
Address: "registry.terraform.io/hashicorp/random",
Debug: debug,
})
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit c75de56

Please sign in to comment.