issue listissue status to bring in line with pr prototype

This commit is contained in:
Mislav Marohnić 2019-11-01 14:33:44 +01:00
parent aea7ae8efd
commit 40131abfba
3 changed files with 8 additions and 12 deletions

View file

@ -13,14 +13,14 @@ func init() {
RootCmd.AddCommand(issueCmd)
issueCmd.AddCommand(
&cobra.Command{
Use: "list",
Short: "List issues",
Use: "status",
Short: "Show status of relevant issues",
RunE: issueList,
},
&cobra.Command{
Use: "view issue-number",
Use: "view <issue-number>",
Args: cobra.MinimumNArgs(1),
Short: "Open a issue in the browser",
Short: "Open an issue in the browser",
RunE: issueView,
},
)
@ -29,11 +29,7 @@ func init() {
var issueCmd = &cobra.Command{
Use: "issue",
Short: "Work with GitHub issues",
Long: `This command allows you to work with issues.`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("%+v is not a valid issue command", args)
},
Long: `Helps you work with issues.`,
}
func issueList(cmd *cobra.Command, args []string) error {

View file

@ -16,9 +16,9 @@ func TestIssueList(t *testing.T) {
defer jsonFile.Close()
http.StubResponse(200, jsonFile)
output, err := test.RunCommand(RootCmd, "issue list")
output, err := test.RunCommand(RootCmd, "issue status")
if err != nil {
t.Errorf("error running command `issue list`: %v", err)
t.Errorf("error running command `issue status`: %v", err)
}
expectedIssues := []*regexp.Regexp{

View file

@ -18,7 +18,7 @@ func init() {
RunE: prList,
},
&cobra.Command{
Use: "view [pr-number]",
Use: "view [<pr-number>]",
Short: "Open a pull request in the browser",
RunE: prView,
},