Browse Source

support command option for starting all tunnels. #129

Xin Yu 10 years ago
parent
commit
15a6b812d5
2 changed files with 7 additions and 0 deletions
  1. 4 0
      src/ngrok/client/cli.go
  2. 3 0
      src/ngrok/client/config.go

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

@@ -22,6 +22,7 @@ Examples:
 Advanced usage: ngrok [OPTIONS] <command> [command args] [...]
 Commands:
 	ngrok start [tunnel] [...]    Start tunnels by name from config file
+	ngork start-all               Start all tunnels defined in config file
 	ngrok list                    List tunnel names from config file
 	ngrok help                    Print help
 	ngrok version                 Print ngrok version
@@ -29,6 +30,7 @@ Commands:
 Examples:
 	ngrok start www api blog pubsub
 	ngrok -log=stdout -config=ngrok.yml start ssh
+	ngrok start-all
 	ngrok version
 
 `
@@ -112,6 +114,8 @@ func ParseArgs() (opts *Options, err error) {
 		opts.args = flag.Args()[1:]
 	case "start":
 		opts.args = flag.Args()[1:]
+	case "start-all":
+		opts.args = flag.Args()[1:]
 	case "version":
 		fmt.Println(version.MajorMinor())
 		os.Exit(0)

+ 3 - 0
src/ngrok/client/config.go

@@ -190,6 +190,9 @@ func LoadConfiguration(opts *Options) (config *Configuration, err error) {
 			}
 		}
 
+	case "start-all":
+		return
+
 	default:
 		err = fmt.Errorf("Unknown command: %s", opts.command)
 		return