fix: parse args correctly for validation
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
9526d1fde6
commit
9dfbd21c61
|
@ -54,12 +54,13 @@ All communication between Abra and the server will use this SSH connection.
|
||||||
},
|
},
|
||||||
ArgsUsage: "<domain> [<user>] [<port>]",
|
ArgsUsage: "<domain> [<user>] [<port>]",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
if c.Args().Len() == 1 && !local {
|
|
||||||
|
if c.Args().Len() == 2 && !local {
|
||||||
err := errors.New("missing arguments <domain> or '--local'")
|
err := errors.New("missing arguments <domain> or '--local'")
|
||||||
internal.ShowSubcommandHelpAndError(c, err)
|
internal.ShowSubcommandHelpAndError(c, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Args().Get(1) != "" && local {
|
if c.Args().Get(2) != "" && local {
|
||||||
err := errors.New("cannot use '<domain>' and '--local' together")
|
err := errors.New("cannot use '<domain>' and '--local' together")
|
||||||
internal.ShowSubcommandHelpAndError(c, err)
|
internal.ShowSubcommandHelpAndError(c, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue