diff --git a/main.go b/main.go index 783d060..96a2bf1 100644 --- a/main.go +++ b/main.go @@ -46,9 +46,14 @@ func newConfig(args []string) (*config, error) { fs := flag.NewFlagSet("ryku", flag.PanicOnError) fs.SetOutput(os.Stdout) + fs.IntVar(&cfg.Port, "p", 8080, "Port to bind at") fs.DurationVar(&cfg.ConnectionTimeout, "timeout", 60*time.Second, "Connection timeout") - fs.Parse(args) + + err := fs.Parse(args) + if err != nil { + return nil, err + } connectionTimeoutSetByFlag := false fs.Visit(func(f *flag.Flag) {