From e5248b8fd44470f08402d72028fc69de881595c3 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Mon, 12 Aug 2024 14:16:09 -0700 Subject: [PATCH 1/2] Update `gh search prs --project` flag doc to specify `owner/number` syntax There are no code changes required to make this work. I added a test specifying `/` and nothing failed. Any syntax issues are returned by the api with a generic message: ``` Invalid search query "project:\"\" type:pr". An invalid project was specified. ``` This, combined with the updated docstring, should be sufficient for users to troubleshoot any issues with the `--project` flag syntax --- pkg/cmd/search/prs/prs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/search/prs/prs.go b/pkg/cmd/search/prs/prs.go index 32565a580e8..fa00677e613 100644 --- a/pkg/cmd/search/prs/prs.go +++ b/pkg/cmd/search/prs/prs.go @@ -168,7 +168,7 @@ func NewCmdPrs(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *cobr cmd.Flags().BoolVar(&noLabel, "no-label", false, "Filter on missing label") cmd.Flags().BoolVar(&noMilestone, "no-milestone", false, "Filter on missing milestone") cmd.Flags().BoolVar(&noProject, "no-project", false, "Filter on missing project") - cmd.Flags().StringVar(&opts.Query.Qualifiers.Project, "project", "", "Filter on project board `number`") + cmd.Flags().StringVar(&opts.Query.Qualifiers.Project, "project", "", "Filter on project board `owner/number`") cmd.Flags().StringVar(&opts.Query.Qualifiers.Reactions, "reactions", "", "Filter on `number` of reactions") cmd.Flags().StringSliceVarP(&opts.Query.Qualifiers.Repo, "repo", "R", nil, "Filter on repository") cmdutil.StringEnumFlag(cmd, &opts.Query.Qualifiers.State, "state", "", "", []string{"open", "closed"}, "Filter based on state") From c838da9ee1f0ffa4e764761dc90b46accd6f0da5 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Mon, 12 Aug 2024 14:36:56 -0700 Subject: [PATCH 2/2] Update `gh search issues --project` flag doc to specify `owner/number` syntax There are no code changes required to make this work. I added a test specifying `/` and nothing failed. Any syntax issues are returned by the api with a generic message: ``` Invalid search query "project:\"\" type:issue". An invalid project was specified. ``` This, combined with the updated docstring, should be sufficient for users to troubleshoot any issues with the `--project` flag syntax --- pkg/cmd/search/issues/issues.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/search/issues/issues.go b/pkg/cmd/search/issues/issues.go index a8be32f71ed..793eecc6198 100644 --- a/pkg/cmd/search/issues/issues.go +++ b/pkg/cmd/search/issues/issues.go @@ -157,7 +157,7 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c cmd.Flags().BoolVar(&noLabel, "no-label", false, "Filter on missing label") cmd.Flags().BoolVar(&noMilestone, "no-milestone", false, "Filter on missing milestone") cmd.Flags().BoolVar(&noProject, "no-project", false, "Filter on missing project") - cmd.Flags().StringVar(&opts.Query.Qualifiers.Project, "project", "", "Filter on project board `number`") + cmd.Flags().StringVar(&opts.Query.Qualifiers.Project, "project", "", "Filter on project board `owner/number`") cmd.Flags().StringVar(&opts.Query.Qualifiers.Reactions, "reactions", "", "Filter on `number` of reactions") cmd.Flags().StringSliceVarP(&opts.Query.Qualifiers.Repo, "repo", "R", nil, "Filter on repository") cmdutil.StringEnumFlag(cmd, &opts.Query.Qualifiers.State, "state", "", "", []string{"open", "closed"}, "Filter based on state")