From b054ce6b3f6856ca7916fc4e1d79d3be16441927 Mon Sep 17 00:00:00 2001 From: Emile Date: Mon, 27 Jan 2020 20:27:23 +0100 Subject: parseFlags --- src/flags.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/flags.go 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, + } +} -- cgit 1.4.1