fix(command,proxy): allow from flag to be optional
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit
Details
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit
Details
This commit is contained in:
parent
8d91f646c2
commit
6559d1f594
|
@ -19,7 +19,7 @@ func CreateCommand() *cli.Command {
|
||||||
Name: "create",
|
Name: "create",
|
||||||
Usage: "Create proxy",
|
Usage: "Create proxy",
|
||||||
Flags: proxyFlag.WithProxyFlags(
|
Flags: proxyFlag.WithProxyFlags(
|
||||||
flag.ProxyTo(),
|
flag.ProxyTo(true),
|
||||||
flag.ProxyFrom(),
|
flag.ProxyFrom(),
|
||||||
),
|
),
|
||||||
Action: func(ctx *cli.Context) error {
|
Action: func(ctx *cli.Context) error {
|
||||||
|
|
|
@ -30,12 +30,12 @@ func ProxyName() cli.Flag {
|
||||||
|
|
||||||
const KeyProxyTo = "proxy-to"
|
const KeyProxyTo = "proxy-to"
|
||||||
|
|
||||||
func ProxyTo() cli.Flag {
|
func ProxyTo(required bool) cli.Flag {
|
||||||
return &cli.StringFlag{
|
return &cli.StringFlag{
|
||||||
Name: KeyProxyTo,
|
Name: KeyProxyTo,
|
||||||
Usage: "Set `PROXY_TO` as proxy's destination url",
|
Usage: "Set `PROXY_TO` as proxy's destination url",
|
||||||
Value: "",
|
Value: "",
|
||||||
Required: true,
|
Required: required,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ func UpdateCommand() *cli.Command {
|
||||||
Name: "update",
|
Name: "update",
|
||||||
Usage: "Update proxy",
|
Usage: "Update proxy",
|
||||||
Flags: proxyFlag.WithProxyFlags(
|
Flags: proxyFlag.WithProxyFlags(
|
||||||
flag.ProxyTo(),
|
flag.ProxyTo(false),
|
||||||
flag.ProxyFrom(),
|
flag.ProxyFrom(),
|
||||||
flag.ProxyEnabled(),
|
flag.ProxyEnabled(),
|
||||||
flag.ProxyWeight(),
|
flag.ProxyWeight(),
|
||||||
|
|
Loading…
Reference in New Issue