From cb61245078a0e8f14e359ed20e0582a695645a08 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sun, 14 Feb 2021 16:03:51 +0100 Subject: Add ability to search by arbitrary metadata Example: ~/git/git-bug/git-bug ls --metadata github-url=https://github.com/author/myproject/issues/42 or ~/git/git-bug/git-bug ls metadata:github-url:\"https://github.com/author/myproject/issues/42\" Fixes the cmdline part of . --- query/query.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'query/query.go') diff --git a/query/query.go b/query/query.go index 816d6414..3a2321cf 100644 --- a/query/query.go +++ b/query/query.go @@ -23,10 +23,17 @@ func NewQuery() *Query { type Search []string +// Used for key-value pairs when filtering based on metadata +type StringPair struct { + Key string + Value string +} + // Filters is a collection of Filter that implement a complex filter type Filters struct { Status []bug.Status Author []string + Metadata []StringPair Actor []string Participant []string Label []string -- cgit From fab626a7a663a8fa6ef27848bb63e91af812ab8c Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 27 Feb 2021 20:31:10 +0100 Subject: query: refactor to reuse the split function for both query and token --- query/query.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'query/query.go') diff --git a/query/query.go b/query/query.go index 3a2321cf..cce61a54 100644 --- a/query/query.go +++ b/query/query.go @@ -23,9 +23,9 @@ func NewQuery() *Query { type Search []string -// Used for key-value pairs when filtering based on metadata +// StringPair is a key/value pair of strings type StringPair struct { - Key string + Key string Value string } -- cgit