cmd/fetchlogs: add a flag to fetch from non-default repos

Change-Id: Ib4c8a8ba72b7e34ae48e73187f89f9ada701ce34
Reviewed-on: https://go-review.googlesource.com/c/build/+/206417
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/fetchlogs/fetchlogs.go b/cmd/fetchlogs/fetchlogs.go
index 0cd84b5..b8c636b 100644
--- a/cmd/fetchlogs/fetchlogs.go
+++ b/cmd/fetchlogs/fetchlogs.go
@@ -44,9 +44,10 @@
 var defaultDir = filepath.Join(xdgCacheDir(), "fetchlogs")
 
 var (
-	flagN   = flag.Int("n", 300, "limit to most recent `N` commits")
-	flagPar = flag.Int("j", 5, "number of concurrent download `jobs`")
-	flagDir = flag.String("dir", defaultDir, "`directory` to save logs to")
+	flagN    = flag.Int("n", 300, "limit to most recent `N` commits")
+	flagPar  = flag.Int("j", 5, "number of concurrent download `jobs`")
+	flagDir  = flag.String("dir", defaultDir, "`directory` to save logs to")
+	flagRepo = flag.String("repo", "go", `repo to fetch logs for`)
 )
 
 func main() {
@@ -98,7 +99,7 @@
 			if haveCommits > *flagN {
 				break
 			}
-			if rev.Repo != "go" {
+			if rev.Repo != *flagRepo {
 				continue
 			}