Use cobra Example field for issue & PR create examples

This commit is contained in:
AliabbasMerchant 2020-06-10 09:55:19 +05:30
parent a775562379
commit 4749e91c53
2 changed files with 18 additions and 24 deletions

View file

@ -61,16 +61,13 @@ var issueCreateCmd = &cobra.Command{
Use: "create",
Short: "Create a new issue",
RunE: issueCreate,
Long: `Create a new issue in a repository
Examples:
$ gh issue create
$ gh issue create -t "Issue With Title And Body" -b "This is the issue body"
$ gh issue create -t OpenAWebBrowserToCreateThisIssue --web
$ gh issue create -t IssueWithLabels -b IssueBody -l label1,label2
$ gh issue create -t IssueWithAssignees -b IssueBody -a user1Login,user2Login
$ gh issue create -t IssueWithProjects -b IssueBody -p cli/1,cli/2
$ gh issue create -t IssueWithMilestone -b IssueBody -m someMilestone
Example: `$ gh issue create
$ gh issue create -t "Issue With Title And Body" -b "This is the issue body"
$ gh issue create -t OpenAWebBrowserToCreateThisIssue --web
$ gh issue create -t IssueWithLabels -b IssueBody -l label1,label2
$ gh issue create -t IssueWithAssignees -b IssueBody -a user1Login,user2Login
$ gh issue create -t IssueWithProjects -b IssueBody -p cli/1,cli/2
$ gh issue create -t IssueWithMilestone -b IssueBody -m someMilestone
`,
}
var issueListCmd = &cobra.Command{

View file

@ -409,20 +409,17 @@ var prCreateCmd = &cobra.Command{
Use: "create",
Short: "Create a pull request",
RunE: prCreate,
Long: `Create a pull request in a repository
Examples:
$ gh pr create
$ gh pr create --fill
$ gh pr create -t "PR With Title And Body" -b "This is the pull request body"
$ gh pr create -t OpenAWebBrowserToCreateThisPR --web
$ gh pr create -t DraftPR --draft
$ gh pr create -t PRWithBaseBranch -b PRBody -B branchName
$ gh pr create -t PRWithReviewers -b PRBody -r user1Login,user2Login
$ gh pr create -t PRWithLabels -b PRBody -l label1,label2
$ gh pr create -t PRWithProjects -b PRBody -p cli/1,cli/2
$ gh pr create -t PRWithAssignees -b PRBody -a user1Login,user2Login
$ gh pr create -t PRWithMilestone -b PRBody -m someMilestone
Example: `$ gh pr create
$ gh pr create --fill
$ gh pr create -t "PR With Title And Body" -b "This is the pull request body"
$ gh pr create -t OpenAWebBrowserToCreateThisPR --web
$ gh pr create -t DraftPR --draft
$ gh pr create -t PRWithBaseBranch -b PRBody -B branchName
$ gh pr create -t PRWithReviewers -b PRBody -r user1Login,user2Login
$ gh pr create -t PRWithLabels -b PRBody -l label1,label2
$ gh pr create -t PRWithProjects -b PRBody -p cli/1,cli/2
$ gh pr create -t PRWithAssignees -b PRBody -a user1Login,user2Login
$ gh pr create -t PRWithMilestone -b PRBody -m someMilestone
`,
}