diff --git a/cli.go b/cli.go index a228a1a17..1ec3938a5 100644 --- a/cli.go +++ b/cli.go @@ -172,9 +172,17 @@ func parseCLIOptions(cx *cli.Context, config *Config) (err error) { for _, x := range cx.StringSlice(name) { reflect.Append(reflect.ValueOf(config).Elem().FieldByName(field.Name), reflect.ValueOf(x)) } + case reflect.Int64: + switch field.Type.String() { + case "time.Duration": + reflect.ValueOf(config).Elem().FieldByName(field.Name).SetInt(int64(cx.Duration(name))) + default: + reflect.ValueOf(config).Elem().FieldByName(field.Name).SetInt(cx.Int64(name)) + } } } } + fmt.Printf("cors %s", config.CorsMaxAge.String()) if cx.IsSet("tag") { tags, err := decodeKeyPairs(cx.StringSlice("tag")) if err != nil {