Avoid saying "number as argument" for issue/pr view
Since issue URLs, PR URLs, and PR branch names are all accepted as arguments, avoid explicitly requesting "number" as argument.
This commit is contained in:
parent
50a89564a7
commit
f58dd04074
3 changed files with 2 additions and 6 deletions
|
|
@ -68,7 +68,7 @@ var issueViewCmd = &cobra.Command{
|
|||
Use: "view {<number> | <url> | <branch>}",
|
||||
Args: func(cmd *cobra.Command, args []string) error {
|
||||
if len(args) < 1 {
|
||||
return errors.New("requires an issue number as an argument")
|
||||
return FlagError{errors.New("issue required as argument")}
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
|
|
|||
|
|
@ -285,10 +285,6 @@ func prView(cmd *cobra.Command, args []string) error {
|
|||
} else {
|
||||
pr, err = api.PullRequestForBranch(apiClient, baseRepo, branchWithOwner)
|
||||
if err != nil {
|
||||
var notFoundErr *api.NotFoundError
|
||||
if errors.As(err, ¬FoundErr) {
|
||||
return fmt.Errorf("%s. To open a specific pull request use the pull request's number as an argument", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ func TestPRView_noResultsForBranch(t *testing.T) {
|
|||
defer restoreCmd()
|
||||
|
||||
_, err := RunCommand(prViewCmd, "pr view")
|
||||
if err == nil || err.Error() != `no open pull requests found for branch "blueberries". To open a specific pull request use the pull request's number as an argument` {
|
||||
if err == nil || err.Error() != `no open pull requests found for branch "blueberries"` {
|
||||
t.Errorf("error running command `pr view`: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue