diff options
| author | Emile <hanemile@protonmail.com> | 2020-01-27 20:27:23 +0100 |
|---|---|---|
| committer | Emile <hanemile@protonmail.com> | 2020-01-27 20:27:23 +0100 |
| commit | b054ce6b3f6856ca7916fc4e1d79d3be16441927 (patch) | |
| tree | ac95262ba757fed4896e4e6e8ca2e07d46fe9b7f | |
| parent | 651f15d9b8bde1b024f97a42e92634afdc1eeda7 (diff) | |
parseFlags
| -rw-r--r-- | src/flags.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/flags.go b/src/flags.go new file mode 100644 index 0000000..1fd28df --- /dev/null +++ b/src/flags.go @@ -0,0 +1,15 @@ +package main + +import "flag" + +func parseFlags() config { + sshPort := flag.Int("sshPort", 2222, "the port the ssh server is listening on") + httpPort := flag.Int("httpPort", 8084, "the port the http server is listening on") + + flag.Parse() + + return config{ + sshPort: *sshPort, + httpPort: *httpPort, + } +} |
