From 9dfbd21c61b0265403d1d391e794e5b3ed9db1cc Mon Sep 17 00:00:00 2001 From: decentral1se Date: Mon, 18 Oct 2021 09:43:32 +0200 Subject: [PATCH] fix: parse args correctly for validation --- cli/server/add.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/server/add.go b/cli/server/add.go index d2d15e9b..e218b280 100644 --- a/cli/server/add.go +++ b/cli/server/add.go @@ -54,12 +54,13 @@ All communication between Abra and the server will use this SSH connection. }, ArgsUsage: " [] []", Action: func(c *cli.Context) error { - if c.Args().Len() == 1 && !local { + + if c.Args().Len() == 2 && !local { err := errors.New("missing arguments or '--local'") internal.ShowSubcommandHelpAndError(c, err) } - if c.Args().Get(1) != "" && local { + if c.Args().Get(2) != "" && local { err := errors.New("cannot use '' and '--local' together") internal.ShowSubcommandHelpAndError(c, err) }