From e84383589e2f181440d05e1925505ffb17639e84 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Tue, 8 Nov 2022 11:15:39 -0800 Subject: [PATCH] add more usage info --- pkg/cmd/extension/command.go | 37 +++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/extension/command.go b/pkg/cmd/extension/command.go index 552a9d1a5..98ab4876c 100644 --- a/pkg/cmd/extension/command.go +++ b/pkg/cmd/extension/command.go @@ -59,10 +59,23 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "search []", - Short: "Search available gh extensions", + Short: "Search through available gh extensions", Long: heredoc.Doc(` Search for gh extensions. + With no arguments, this command prints out the first 30 available + extensions sorted by number of stars. More extensions can be fetched + by specifying a higher limit with the --limit flag. + + When connected to a terminal, this command prints out three columns. + The first has a ✓ if the extension is installed locally. The second + is the full name of the extension repository in NAME/OWNER format. + The third is the extension's description. + + When not connected to a terminal, the ✓ character is rendered as the + word "installed" but otherwise the order and content of the columns + is the same. + This command behaves similarly to 'gh search repos' but does not support as many search qualifiers. For a finer grained search of extensions, try using: @@ -72,6 +85,28 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command { and adding qualifiers as needed. See 'gh help search repos' to learn more about repository search. `), + Example: heredoc.Doc(` + # List the first 30 extensions sorted by star count, descending + $ gh ext search + + # List more extensions + $ gh ext search -L300 + + # List extensions matching the term "branch" + $ gh ext search branch + + # List extensions owned by organization "github" + $ gh ext search --owner github + + # List extensions, sorting by recently updated, ascending + $ gh ext search --sort updated --order asc + + # List extensions, filtering by license + $ gh ext search --license MIT + + # Open search results in the browser + $ gh ext search -w + `), RunE: func(cmd *cobra.Command, args []string) error { cfg, err := config() if err != nil {