From 167e868fe2273de427dc5694a9a3c36ae392eddd Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:11:10 -0700 Subject: [PATCH] docs: enhance help text and prompt for rename command --- pkg/cmd/repo/rename/rename.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/repo/rename/rename.go b/pkg/cmd/repo/rename/rename.go index 3676f93fe..74523e2e7 100644 --- a/pkg/cmd/repo/rename/rename.go +++ b/pkg/cmd/repo/rename/rename.go @@ -49,9 +49,27 @@ func NewCmdRename(f *cmdutil.Factory, runf func(*RenameOptions) error) *cobra.Co cmd := &cobra.Command{ Use: "rename []", Short: "Rename a repository", - Long: heredoc.Doc(`Rename a GitHub repository. + Long: heredoc.Docf(` + Rename a GitHub repository. + + %[1]s%[1]s is the desired repository name without the owner. + + By default, the current repository is renamed. Otherwise, the repository specified + with %[1]s--repo%[1]s is renamed. + + To transfer repository ownership to another user account or organization, + you must follow additional steps on GitHub.com - By default, this renames the current repository; otherwise renames the specified repository.`), + For more information on transferring repository ownership, see: + + `, "`"), + Example: heredoc.Doc(` + # Rename the current repository (foo/bar -> foo/baz) + $ gh repo rename baz + + # Rename the specified repository (qux/quux -> qux/baz) + $ gh repo rename -R qux/quux baz + `), Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { opts.BaseRepo = f.BaseRepo