From c80e00831c5fb35423ef0803588a83551f7d9de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Moyne?= Date: Wed, 27 Sep 2023 11:40:23 -0700 Subject: [PATCH] [ADDED] `consumer add` when prompting for subject filter(s) can parse the user input as a comma or space separated list of subject filters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-Noël Moyne --- cli/consumer_command.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/consumer_command.go b/cli/consumer_command.go index 4cbb7464..bc4ecffd 100644 --- a/cli/consumer_command.go +++ b/cli/consumer_command.go @@ -1128,12 +1128,12 @@ func (c *consumerCmd) prepareConfig(pc *fisk.ParseContext) (cfg *api.ConsumerCon case len(c.filterSubjects) == 0 && !c.acceptDefaults: sub := "" err = askOne(&survey.Input{ - Message: "Filter Stream by subject (blank for all)", + Message: "Filter Stream by subjects (blank for all)", Default: "", - Help: "Stream can consume more than one subject - or a wildcard - this allows you to filter out just a single subject from all the ones entering the Stream for delivery to the Consumer. Settable using --filter", + Help: "Consumers can filter messages from the stream, this is a space or comma separated list that can include wildcards. Settable using --filter", }, &sub) fisk.FatalIfError(err, "could not ask for filtering subject") - c.filterSubjects = []string{sub} + c.filterSubjects = splitString(sub) } switch {