From 916f44ea23bea3baeec362f50b8f8147a3bcc82d Mon Sep 17 00:00:00 2001 From: Ricardo Urrea Date: Mon, 29 Jul 2024 17:18:29 +0200 Subject: [PATCH] fix: client cmd out of index error --- client/client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index d45ebcf..0bf1d0b 100644 --- a/client/client.go +++ b/client/client.go @@ -219,8 +219,9 @@ func flagSanityCheck(clientFlags *flag.FlagSet) error { if conf.FlagIsDefined(clientFlags, "template") { flagExclusion = append(flagExclusion, "-template") } - if len(clientFlags.Args()) > 1 { - flagExclusion = append(flagExclusion, clientFlags.Args()...) + argNumber := len(clientFlags.Args()) + if argNumber != 1 { + return fmt.Errorf("%s client requires exactly one valid server address as an argument", clientType) } } if len(flagExclusion) > 0 {