Skip to content

Commit

Permalink
goplus#1300 gop build/run/install/test pass build flags
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Jun 26, 2022
1 parent 58d06d2 commit 207a7a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/internal/install/install.go
Expand Up @@ -48,7 +48,8 @@ func init() {
Cmd.Run = runCmd
}

func runCmd(_ *base.Command, args []string) {
func runCmd(cmd *base.Command, args []string) {
pass := base.PassBuildFlags(cmd)
err := flag.Parse(args)
if err != nil {
log.Fatalln("parse input arguments failed:", err)
Expand All @@ -73,6 +74,7 @@ func runCmd(_ *base.Command, args []string) {
gopEnv := gopenv.Get()
conf := &gop.Config{Gop: gopEnv}
confCmd := &gocmd.Config{Gop: gopEnv}
confCmd.Flags = pass.Args
for _, proj := range projs {
install(proj, conf, confCmd)
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/internal/run/run.go
Expand Up @@ -54,6 +54,7 @@ func init() {
}

func runCmd(cmd *base.Command, args []string) {
pass := base.PassBuildFlags(cmd)
err := flag.Parse(args)
if err != nil {
log.Fatalln("parse input arguments failed:", err)
Expand Down Expand Up @@ -89,6 +90,7 @@ func runCmd(cmd *base.Command, args []string) {
gopEnv := gopenv.Get()
conf := &gop.Config{Gop: gopEnv}
confCmd := &gocmd.Config{Gop: gopEnv}
confCmd.Flags = pass.Args
run(proj, args, !noChdir, conf, confCmd)
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/internal/test/test.go
Expand Up @@ -48,7 +48,8 @@ func init() {
Cmd.Run = runCmd
}

func runCmd(_ *base.Command, args []string) {
func runCmd(cmd *base.Command, args []string) {
pass := base.PassBuildFlags(cmd)
err := flag.Parse(args)
if err != nil {
log.Fatalln("parse input arguments failed:", err)
Expand All @@ -73,6 +74,7 @@ func runCmd(_ *base.Command, args []string) {
gopEnv := gopenv.Get()
conf := &gop.Config{Gop: gopEnv}
confCmd := &gocmd.Config{Gop: gopEnv}
confCmd.Flags = pass.Args
for _, proj := range projs {
test(proj, conf, confCmd)
}
Expand Down

0 comments on commit 207a7a4

Please sign in to comment.