dip/utils/utils.go

21 lines
348 B
Go
Raw Normal View History

2020-01-27 21:16:08 +01:00
package utils
2020-03-10 14:58:20 +01:00
import (
"flag"
"os"
)
2020-01-27 21:16:08 +01:00
2020-03-10 14:58:20 +01:00
// Flags configure flag management
2020-01-27 21:16:08 +01:00
func Flags(host *string, port *string) {
flag.Usage = Usage
flag.StringVar(host, "host", "[::]", "Listen host")
flag.StringVar(port, "port", "8080", "Listen port")
flag.Parse()
}
2020-03-10 14:58:20 +01:00
// Usage displays possible arguments
func Usage() {
flag.PrintDefaults()
os.Exit(1)
}