Add help topic for search syntax in gh commands
Introduces a new help topic explaining how to use exclusion qualifiers in GitHub search syntax with gh commands, including platform-specific instructions for Unix-like systems and PowerShell. Provides links to relevant documentation for further reference. Co-Authored-By: Sid <41968447+sukhpreet-s@users.noreply.github.com>
This commit is contained in:
parent
45876eddc2
commit
254119e498
1 changed files with 29 additions and 0 deletions
|
|
@ -304,6 +304,35 @@ var HelpTopics = []helpTopic{
|
||||||
control some behavior.
|
control some behavior.
|
||||||
`),
|
`),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "search",
|
||||||
|
short: "Search syntax for gh commands",
|
||||||
|
long: heredoc.Docf(`
|
||||||
|
Excluding search results that match a qualifier
|
||||||
|
|
||||||
|
In a browser, the GitHub search syntax supports excluding results that match a search qualifier
|
||||||
|
by prefixing the qualifier with a hyphen. For example, to search for issues that
|
||||||
|
do not have the label "bug", you would use %[1]s-label:bug%[1]s as a search qualifier.
|
||||||
|
|
||||||
|
%[1]sgh%[1]s supports this syntax in %[1]sgh search%[1]s as well, but it requires extra
|
||||||
|
syntax to avoid the hyphen being interpreted as a command line flag because it begins with a hyphen.
|
||||||
|
|
||||||
|
On Unix-like systems, you can use the %[1]s--%[1]s argument to indicate that
|
||||||
|
the arguments that follow are not a flag, but rather a query string. For example:
|
||||||
|
|
||||||
|
$ gh search issues -- "my-search-query -label:bug"
|
||||||
|
|
||||||
|
On PowerShell, you must use both the %[1]s--%[2]s%[1]s argument and the %[1]s--%[1]s argument to
|
||||||
|
produce the same effect. For example:
|
||||||
|
|
||||||
|
$ gh --%[2]s search issues -- "my search query -label:bug"
|
||||||
|
|
||||||
|
See the following for more information:
|
||||||
|
- GitHub search syntax: <https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#exclude-results-that-match-a-qualifier>
|
||||||
|
- The PowerShell stop parse flag %[1]s--%[2]s%[1]s: <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.5#the-stop-parsing-token>
|
||||||
|
- The Unix-like %[1]s--%[1]s argument: <https://www.gnu.org/software/bash/manual/bash.html#Shell-Builtin-Commands-1>
|
||||||
|
`, "`", "%"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCmdHelpTopic(ios *iostreams.IOStreams, ht helpTopic) *cobra.Command {
|
func NewCmdHelpTopic(ios *iostreams.IOStreams, ht helpTopic) *cobra.Command {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue