From f425097c5a451d12e9eb523e6abf47956de70d9a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 26 Nov 2024 12:05:38 -0300 Subject: [PATCH] allow filters with long tags (the 1-char restriction is only a convention, not a rule). fixes https://github.com/fiatjaf/nak/issues/44 --- count.go | 2 +- req.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/count.go b/count.go index 906b516..36c0bd5 100644 --- a/count.go +++ b/count.go @@ -85,7 +85,7 @@ var count = &cli.Command{ tags := make([][]string, 0, 5) for _, tagFlag := range c.StringSlice("tag") { spl := strings.SplitN(tagFlag, "=", 2) - if len(spl) == 2 && len(spl[0]) == 1 { + if len(spl) == 2 { tags = append(tags, spl) } else { return fmt.Errorf("invalid --tag '%s'", tagFlag) diff --git a/req.go b/req.go index f4a143a..4b0b92a 100644 --- a/req.go +++ b/req.go @@ -232,7 +232,7 @@ func applyFlagsToFilter(c *cli.Command, filter *nostr.Filter) error { tags := make([][]string, 0, 5) for _, tagFlag := range c.StringSlice("tag") { spl := strings.SplitN(tagFlag, "=", 2) - if len(spl) == 2 && len(spl[0]) == 1 { + if len(spl) == 2 { tags = append(tags, spl) } else { return fmt.Errorf("invalid --tag '%s'", tagFlag)