From 96f123bce10a6e93106135ff92a6d88d04ba7ace Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 6 Jul 2016 19:12:00 +0100 Subject: [PATCH] Ensure default ports are specified --- cli/setup.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli/setup.go b/cli/setup.go index 296b6a2b..3e756a3e 100644 --- a/cli/setup.go +++ b/cli/setup.go @@ -112,6 +112,16 @@ func setup() { // Ports // -------------------------------------------------- + // Specify default port + if opts.Port.Web == 0 { + opts.Port.Web = 8000 + } + + // Specify default port + if opts.Port.Tcp == 0 { + opts.Port.Tcp = 33693 + } + // Ensure port number is valid if opts.Port.Web < 0 || opts.Port.Web > 65535 { log.Fatal("Please specify a valid port number for --port-web")