fix: parse args correctly for validation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
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>]",
|
||||
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'")
|
||||
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")
|
||||
internal.ShowSubcommandHelpAndError(c, err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user