renamed github flag to username based on feedback

This commit is contained in:
alexkappa 2015-01-27 16:58:21 +01:00
parent 76c15c68ce
commit 44d1b902ee

View File

@ -20,7 +20,7 @@ var httpsFlag = flag.String("https", "", "Serve HTTPS at given address")
var certFlag = flag.String("cert", "", "Use the provided TLS certificate")
var keyFlag = flag.String("key", "", "Use the provided TLS key")
var domainFlag = flag.String("domain", "gopkg.in", "Domain name")
var githubFlag = flag.String("github", "", "Github username")
var userFlag = flag.String("username", "", "Github username")
func main() {
if err := run(); err != nil {
@ -81,14 +81,13 @@ type Repo struct {
// GitHubRoot returns the repository root at GitHub, without a schema.
func (repo *Repo) GitHubRoot() string {
if *githubFlag != "" {
return "github.com/" + *githubFlag + "/" + repo.Name
if *userFlag != "" {
return "github.com/" + *userFlag + "/" + repo.Name
}
if repo.User == "" {
return "github.com/go-" + repo.Name + "/" + repo.Name
} else {
return "github.com/" + repo.User + "/" + repo.Name
}
return "github.com/" + repo.User + "/" + repo.Name
}
// GopkgRoot returns the package root at gopkg.in, without a schema.