(options FilterOptions, advancedIssueSearchSyntax bool)
| 233 | } |
| 234 | |
| 235 | func SearchQueryBuild(options FilterOptions, advancedIssueSearchSyntax bool) string { |
| 236 | var is, state string |
| 237 | switch options.State { |
| 238 | case "open", "closed": |
| 239 | state = options.State |
| 240 | case "merged": |
| 241 | is = "merged" |
| 242 | } |
| 243 | |
| 244 | query := search.Query{ |
| 245 | Qualifiers: search.Qualifiers{ |
| 246 | Assignee: options.Assignee, |
| 247 | Author: options.Author, |
| 248 | Base: options.BaseBranch, |
| 249 | Draft: options.Draft, |
| 250 | Head: options.HeadBranch, |
| 251 | IssueType: options.IssueType, |
| 252 | Label: options.Labels, |
| 253 | Mentions: options.Mention, |
| 254 | Milestone: options.Milestone, |
| 255 | Repo: []string{options.Repo}, |
| 256 | State: state, |
| 257 | Is: []string{is}, |
| 258 | Type: options.Entity, |
| 259 | }, |
| 260 | ImmutableKeywords: options.Search, |
| 261 | } |
| 262 | |
| 263 | if !advancedIssueSearchSyntax { |
| 264 | return query.StandardSearchString() |
| 265 | } |
| 266 | return query.AdvancedIssueSearchString() |
| 267 | } |
| 268 | |
| 269 | func QueryHasStateClause(searchQuery string) bool { |
| 270 | argv, err := shlex.Split(searchQuery) |
no test coverage detected