Browse Source

add cli option for specifying your email/username

Alan Shreve 12 years ago
parent
commit
2787366a57
2 changed files with 8 additions and 0 deletions
  1. 7 0
      src/ngrok/client/cli.go
  2. 1 0
      src/ngrok/client/main.go

+ 7 - 0
src/ngrok/client/cli.go

@@ -25,6 +25,7 @@ type Options struct {
 	historySize int
 	webport     int
 	logto       string
+	user        string
 }
 
 func fail(msg string, args ...interface{}) {
@@ -92,6 +93,11 @@ func parseProtocol(proto string) string {
 }
 
 func parseArgs() *Options {
+	user := flag.String(
+		"email",
+		"",
+		"Email address of your premium ngrok.com account")
+
 	server := flag.String(
 		"server",
 		"ngrok.com:4443",
@@ -142,5 +148,6 @@ func parseArgs() *Options {
 		protocol:  parseProtocol(*protocol),
 		webport:   *webport,
 		logto:     *logto,
+		user:      *user,
 	}
 }

+ 1 - 0
src/ngrok/client/main.go

@@ -197,6 +197,7 @@ func control(s *State, ctl *ui.Controller) {
 		ClientId:  s.id,
 		Version:   version.Proto,
 		MmVersion: version.MajorMinor(),
+		User:      s.opts.user,
 	})
 
 	if err != nil {