From 45876eddc290075e4ad148b5028f26b6472b09de Mon Sep 17 00:00:00 2001 From: Sukh Date: Mon, 23 Jun 2025 13:19:37 -0400 Subject: [PATCH] docs(search): add note for exclusion search syntax --- pkg/cmd/search/code/code.go | 3 +++ pkg/cmd/search/commits/commits.go | 3 +++ pkg/cmd/search/issues/issues.go | 3 +++ pkg/cmd/search/prs/prs.go | 3 +++ pkg/cmd/search/repos/repos.go | 3 +++ 5 files changed, 15 insertions(+) diff --git a/pkg/cmd/search/code/code.go b/pkg/cmd/search/code/code.go index d03526c4d..3a439e5cd 100644 --- a/pkg/cmd/search/code/code.go +++ b/pkg/cmd/search/code/code.go @@ -46,6 +46,9 @@ func NewCmdCode(f *cmdutil.Factory, runF func(*CodeOptions) error) *cobra.Comman Note that these search results are powered by what is now a legacy GitHub code search engine. The results might not match what is seen on %[1]sgithub.com%[1]s, and new features like regex search are not yet available via the GitHub API. + + Note: When using GitHub search syntax to exclude results (e.g. '-language:xml'), you must use + a '--' delimiter before the search query to separate it from command flags. `, "`"), Example: heredoc.Doc(` # Search code matching "react" and "lifecycle" diff --git a/pkg/cmd/search/commits/commits.go b/pkg/cmd/search/commits/commits.go index fb1742dc9..161ecc6a9 100644 --- a/pkg/cmd/search/commits/commits.go +++ b/pkg/cmd/search/commits/commits.go @@ -45,6 +45,9 @@ func NewCmdCommits(f *cmdutil.Factory, runF func(*CommitsOptions) error) *cobra. GitHub search syntax is documented at: + + Note: When using GitHub search syntax to exclude results (e.g. '-user:monalisa'), you must use + a '--' delimiter before the search query to separate it from command flags. `), Example: heredoc.Doc(` # Search commits matching set of keywords "readme" and "typo" diff --git a/pkg/cmd/search/issues/issues.go b/pkg/cmd/search/issues/issues.go index e1f4105ae..af6e9d64c 100644 --- a/pkg/cmd/search/issues/issues.go +++ b/pkg/cmd/search/issues/issues.go @@ -34,6 +34,9 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c GitHub search syntax is documented at: + + Note: When using GitHub search syntax to exclude results (e.g. '-label:bug'), you must use + a '--' delimiter before the search query to separate it from command flags. `), Example: heredoc.Doc(` # Search issues matching set of keywords "readme" and "typo" diff --git a/pkg/cmd/search/prs/prs.go b/pkg/cmd/search/prs/prs.go index f7a96c5bf..b268ea3e5 100644 --- a/pkg/cmd/search/prs/prs.go +++ b/pkg/cmd/search/prs/prs.go @@ -36,6 +36,9 @@ func NewCmdPrs(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *cobr GitHub search syntax is documented at: + + Note: When using GitHub search syntax to exclude results (e.g. '-label:bug'), you must use + a '--' delimiter before the search query to separate it from command flags. `), Example: heredoc.Doc(` # Search pull requests matching set of keywords "fix" and "bug" diff --git a/pkg/cmd/search/repos/repos.go b/pkg/cmd/search/repos/repos.go index 2815ee6dc..733d7b7c4 100644 --- a/pkg/cmd/search/repos/repos.go +++ b/pkg/cmd/search/repos/repos.go @@ -46,6 +46,9 @@ func NewCmdRepos(f *cmdutil.Factory, runF func(*ReposOptions) error) *cobra.Comm GitHub search syntax is documented at: + + Note: When using GitHub search syntax to exclude results (e.g. '-topic:linux'), you must use + a '--' delimiter before the search query to separate it from command flags. `), Example: heredoc.Doc(` # Search repositories matching set of keywords "cli" and "shell"