diff --git a/internal/command/admin/proxy/create.go b/internal/command/admin/proxy/create.go index 90f8bd6..0918b8d 100644 --- a/internal/command/admin/proxy/create.go +++ b/internal/command/admin/proxy/create.go @@ -19,7 +19,7 @@ func CreateCommand() *cli.Command { Name: "create", Usage: "Create proxy", Flags: proxyFlag.WithProxyFlags( - flag.ProxyTo(), + flag.ProxyTo(true), flag.ProxyFrom(), ), Action: func(ctx *cli.Context) error { diff --git a/internal/command/admin/proxy/flag/flag.go b/internal/command/admin/proxy/flag/flag.go index 932d81e..ccbf5a8 100644 --- a/internal/command/admin/proxy/flag/flag.go +++ b/internal/command/admin/proxy/flag/flag.go @@ -30,12 +30,12 @@ func ProxyName() cli.Flag { const KeyProxyTo = "proxy-to" -func ProxyTo() cli.Flag { +func ProxyTo(required bool) cli.Flag { return &cli.StringFlag{ Name: KeyProxyTo, Usage: "Set `PROXY_TO` as proxy's destination url", Value: "", - Required: true, + Required: required, } } diff --git a/internal/command/admin/proxy/update.go b/internal/command/admin/proxy/update.go index 4980bce..2d60888 100644 --- a/internal/command/admin/proxy/update.go +++ b/internal/command/admin/proxy/update.go @@ -19,7 +19,7 @@ func UpdateCommand() *cli.Command { Name: "update", Usage: "Update proxy", Flags: proxyFlag.WithProxyFlags( - flag.ProxyTo(), + flag.ProxyTo(false), flag.ProxyFrom(), flag.ProxyEnabled(), flag.ProxyWeight(),