From 305410cdeef7ca2d75647414236489e40169d6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 23 Jan 2020 10:26:57 +0100 Subject: [PATCH 1/2] Fix usage synopsis for `pr view` Indicate that the argument is optional --- command/pr.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/command/pr.go b/command/pr.go index 5204c1b3d..76eae4a3e 100644 --- a/command/pr.go +++ b/command/pr.go @@ -67,9 +67,13 @@ var prStatusCmd = &cobra.Command{ RunE: prStatus, } var prViewCmd = &cobra.Command{ - Use: "view { | | }", + Use: "view [{ | | }]", Short: "View a pull request in the browser", - RunE: prView, + Long: `View a pull request specified by the argument in the browser. + +Without an argument, the pull request that belongs to the current +branch is opened.`, + RunE: prView, } func prStatus(cmd *cobra.Command, args []string) error { From f5ad43458ccb15bd73b6f19da995271ebf19b8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 23 Jan 2020 10:28:29 +0100 Subject: [PATCH 2/2] Avoid using `<...>` in docs When converted to HTML docs, these get interpreted as HTML tags. In theory, we could encapsulate these bits in backticks, but the docs are already in raw Go string literals, and we can't easily escape backticks in that context. Instead, just avoid using `<>` for now. --- command/issue.go | 2 +- command/pr.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/command/issue.go b/command/issue.go index 139ab3337..f48549522 100644 --- a/command/issue.go +++ b/command/issue.go @@ -47,7 +47,7 @@ var issueCmd = &cobra.Command{ An issue can be supplied as argument in any of the following formats: - by number, e.g. "123"; or -- by URL, e.g. "https://github.com///issues/123".`, +- by URL, e.g. "https://github.com/OWNER/REPO/issues/123".`, } var issueCreateCmd = &cobra.Command{ Use: "create", diff --git a/command/pr.go b/command/pr.go index 76eae4a3e..e210d027c 100644 --- a/command/pr.go +++ b/command/pr.go @@ -42,8 +42,8 @@ var prCmd = &cobra.Command{ A pull request can be supplied as argument in any of the following formats: - by number, e.g. "123"; -- by URL, e.g. "https://github.com///pull/123"; or -- by the name of its head branch, e.g. "patch-1" or ":patch-1".`, +- by URL, e.g. "https://github.com/OWNER/REPO/pull/123"; or +- by the name of its head branch, e.g. "patch-1" or "OWNER:patch-1".`, } var prCheckoutCmd = &cobra.Command{ Use: "checkout { | | }",