Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(133)

Unified Diff: src/cmd/go/main.go

Issue 5495055: code review 5495055: go: implement test command (Closed)
Patch Set: diff -r e4e0c7c99d9d https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/go/build.go ('k') | src/cmd/go/pkg.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/go/main.go
===================================================================
--- a/src/cmd/go/main.go
+++ b/src/cmd/go/main.go
@@ -36,6 +36,10 @@
// Flag is a set of flags specific to this command.
Flag flag.FlagSet
+
+ // CustomFlags indicates that the command will do its own
+ // flag parsing.
+ CustomFlags bool
}
// Name returns the command's name: the first word in the usage line.
@@ -96,8 +100,12 @@
for _, cmd := range commands {
if cmd.Name() == args[0] && cmd.Run != nil {
cmd.Flag.Usage = func() { cmd.Usage() }
- cmd.Flag.Parse(args[1:])
- args = cmd.Flag.Args()
+ if cmd.CustomFlags {
+ args = args[1:]
+ } else {
+ cmd.Flag.Parse(args[1:])
+ args = cmd.Flag.Args()
+ }
cmd.Run(cmd, args)
exit()
return
@@ -209,6 +217,8 @@
exitStatus = 1
}
+var logf = log.Printf
+
func exitIfErrors() {
if exitStatus != 0 {
exit()
« no previous file with comments | « src/cmd/go/build.go ('k') | src/cmd/go/pkg.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b