about summary refs log tree commit diff
path: root/src/flags.go
blob: df7ee52d4a5deb5d2878d2806b048b8df6ddf3cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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")
	bindIP := flag.String("bind", "0.0.0.0", "the ip the servers should be listening on")
	stateFile := flag.String("stateFile", "./statefile.txt", "the file path to store the state in")

	flag.Parse()

	return config{
		sshPort:   *sshPort,
		httpPort:  *httpPort,
		bindIP:    *bindIP,
		stateFile: *stateFile,
	}
}