aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
Diffstat (limited to 'cache')
-rw-r--r--cache/filter.go8
-rw-r--r--cache/query.go7
2 files changed, 7 insertions, 8 deletions
diff --git a/cache/filter.go b/cache/filter.go
index 3bcfe13e..033df131 100644
--- a/cache/filter.go
+++ b/cache/filter.go
@@ -1,8 +1,6 @@
package cache
import (
- "strings"
-
"github.com/MichaelMure/git-bug/bug"
)
@@ -23,12 +21,8 @@ func StatusFilter(query string) (Filter, error) {
// AuthorFilter return a Filter that match a bug author
func AuthorFilter(query string) Filter {
- cleaned := strings.TrimFunc(query, func(r rune) bool {
- return r == '"' || r == '\''
- })
-
return func(excerpt *BugExcerpt) bool {
- return excerpt.Author.Match(cleaned)
+ return excerpt.Author.Match(query)
}
}
diff --git a/cache/query.go b/cache/query.go
index 5be8f43d..198adfc9 100644
--- a/cache/query.go
+++ b/cache/query.go
@@ -12,6 +12,11 @@ type Query struct {
OrderDirection
}
+// Return an identity query
+func NewQuery() *Query {
+ return &Query{}
+}
+
// ParseQuery parse a query DSL
//
// Ex: "status:open author:descartes sort:edit-asc"
@@ -112,7 +117,7 @@ func (q *Query) parseNoFilter(query string) error {
case "label":
q.NoFilters = append(q.NoFilters, NoLabelFilter())
default:
- return fmt.Errorf("unknown \"no\" filter")
+ return fmt.Errorf("unknown \"no\" filter %s", query)
}
return nil