Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
added a -d flag to buffalo dev to run the app with delve
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Jul 19, 2017
1 parent 22f9809 commit 0ec3057
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions buffalo/cmd/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/spf13/cobra"
)

var devOptions = struct {
Debug bool
}{}

// devCmd represents the dev command
var devCmd = &cobra.Command{
Use: "dev",
Expand Down Expand Up @@ -89,11 +93,13 @@ func startDevServer(ctx context.Context) error {
if err != nil {
return err
}
c.Debug = devOptions.Debug
r := refresh.NewWithContext(c, ctx)
return r.Start()
}

func init() {
devCmd.Flags().BoolVarP(&devOptions.Debug, "debug", "d", false, "use delve to debug the app")
decorate("dev", devCmd)
RootCmd.AddCommand(devCmd)
}

0 comments on commit 0ec3057

Please sign in to comment.