Skip to content

Commit 1fc0661

Browse files
committed
Add additional options
1 parent 3599137 commit 1fc0661

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

main.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
// Version is the current application version
15-
const Version = "0.2.0"
15+
const Version = "0.3.0"
1616

1717
func main() {
1818
var dlvPort = new(uint16)
@@ -28,6 +28,10 @@ func main() {
2828
dlvIP := flag.IPP("address", "a", net.ParseIP("0.0.0.0"), "Listen address for delve")
2929
dlvAPIV := flag.IntP("api-version", "v", 2, "API version to use for delve server")
3030
help := flag.BoolP("help", "h", false, "Show help")
31+
ldFlags := flag.StringP("ldflags", "l", "", "Linker flags to pass to the go build tool")
32+
gcFlags := flag.StringP("gcflags", "g", "", "Compiler flags to pass to the go build tool")
33+
useRace := flag.BoolP("race", "c", false, "Enable race detector")
34+
tags := flag.StringSliceP("tags", "", []string{}, "Tags to pass to the go build tool")
3135

3236
flag.Parse()
3337

@@ -45,7 +49,11 @@ func main() {
4549
runner.WatchDirs(*watchDirs...),
4650
runner.ExcludeDirs(*excludeDirs...),
4751
runner.CommandArgs(flag.Args()...),
48-
runner.UseDelve(*useDlv, *dlvAPIV, *dlvPort, *dlvIP))
52+
runner.UseDelve(*useDlv, *dlvAPIV, *dlvPort, *dlvIP),
53+
runner.UseRaceDetector(*useRace),
54+
runner.UseLDFlags(*ldFlags),
55+
runner.UseGCFlags(*gcFlags),
56+
runner.UseTags(*tags...))
4957

5058
if err := r.Watch(); err != nil {
5159
log.Errorln(err)

0 commit comments

Comments
 (0)