diff --git a/completers/gh_completer/cmd/cache_list.go b/completers/gh_completer/cmd/cache_list.go index 17af3d721c..38593f3d0a 100644 --- a/completers/gh_completer/cmd/cache_list.go +++ b/completers/gh_completer/cmd/cache_list.go @@ -19,6 +19,7 @@ func init() { cache_listCmd.Flags().StringP("jq", "q", "", "Filter JSON output using a jq `expression`") cache_listCmd.Flags().StringSlice("json", []string{}, "Output JSON with the specified `fields`") + cache_listCmd.Flags().StringP("key", "k", "", "Filter by cache key prefix") cache_listCmd.Flags().StringP("limit", "L", "", "Maximum number of caches to fetch") cache_listCmd.Flags().StringP("order", "O", "", "Order of caches returned: {asc|desc}") cache_listCmd.Flags().StringP("sort", "S", "", "Sort fetched caches: {created_at|last_accessed_at|size_in_bytes}") diff --git a/completers/gh_completer/cmd/gist_create.go b/completers/gh_completer/cmd/gist_create.go index 7435cdbe66..9b867123ad 100644 --- a/completers/gh_completer/cmd/gist_create.go +++ b/completers/gh_completer/cmd/gist_create.go @@ -17,7 +17,7 @@ func init() { gist_createCmd.Flags().StringP("desc", "d", "", "A description for this gist") gist_createCmd.Flags().StringP("filename", "f", "", "Provide a filename to be used when reading from standard input") - gist_createCmd.Flags().BoolP("public", "p", false, "List the gist publicly (default: secret)") + gist_createCmd.Flags().BoolP("public", "p", false, "List the gist publicly (default \"secret\")") gist_createCmd.Flags().BoolP("web", "w", false, "Open the web browser with created gist") gistCmd.AddCommand(gist_createCmd) diff --git a/completers/gh_completer/cmd/pr_checkout.go b/completers/gh_completer/cmd/pr_checkout.go index bd369fc1c9..a2197c63d7 100644 --- a/completers/gh_completer/cmd/pr_checkout.go +++ b/completers/gh_completer/cmd/pr_checkout.go @@ -16,12 +16,16 @@ var pr_checkoutCmd = &cobra.Command{ func init() { carapace.Gen(pr_checkoutCmd).Standalone() - pr_checkoutCmd.Flags().StringP("branch", "b", "", "Local branch name to use (default: the name of the head branch)") + pr_checkoutCmd.Flags().StringP("branch", "b", "", "Local branch name to use (default [the name of the head branch])") pr_checkoutCmd.Flags().Bool("detach", false, "Checkout PR with a detached HEAD") pr_checkoutCmd.Flags().BoolP("force", "f", false, "Reset the existing local branch to the latest state of the pull request") pr_checkoutCmd.Flags().Bool("recurse-submodules", false, "Update all submodules after checkout") prCmd.AddCommand(pr_checkoutCmd) + carapace.Gen(pr_checkoutCmd).FlagCompletion(carapace.ActionMap{ + "branch": action.ActionBranches(pr_checkoutCmd), + }) + carapace.Gen(pr_checkoutCmd).PositionalCompletion( action.ActionPullRequests(pr_checkoutCmd, action.PullRequestOpts{Open: true}), ) diff --git a/completers/gh_completer/cmd/pr_create.go b/completers/gh_completer/cmd/pr_create.go index 35dba0fc38..6d4d90627f 100644 --- a/completers/gh_completer/cmd/pr_create.go +++ b/completers/gh_completer/cmd/pr_create.go @@ -24,7 +24,8 @@ func init() { pr_createCmd.Flags().BoolP("draft", "d", false, "Mark pull request as a draft") pr_createCmd.Flags().BoolP("fill", "f", false, "Use commit info for title and body") pr_createCmd.Flags().Bool("fill-first", false, "Use first commit info for title and body") - pr_createCmd.Flags().StringP("head", "H", "", "The `branch` that contains commits for your pull request (default: current branch)") + pr_createCmd.Flags().Bool("fill-verbose", false, "Use commits msg+body for description") + pr_createCmd.Flags().StringP("head", "H", "", "The `branch` that contains commits for your pull request (default [current branch])") pr_createCmd.Flags().StringSliceP("label", "l", []string{}, "Add labels by `name`") pr_createCmd.Flags().StringP("milestone", "m", "", "Add the pull request to a milestone by `name`") pr_createCmd.Flags().Bool("no-maintainer-edit", false, "Disable maintainer's ability to modify pull request") diff --git a/completers/gh_completer/cmd/release_create.go b/completers/gh_completer/cmd/release_create.go index 995699c721..d3ad7cdc79 100644 --- a/completers/gh_completer/cmd/release_create.go +++ b/completers/gh_completer/cmd/release_create.go @@ -20,13 +20,13 @@ func init() { release_createCmd.Flags().String("discussion-category", "", "Start a discussion in the specified category") release_createCmd.Flags().BoolP("draft", "d", false, "Save the release as a draft instead of publishing it") release_createCmd.Flags().Bool("generate-notes", false, "Automatically generate title and notes for the release") - release_createCmd.Flags().Bool("latest", false, "Mark this release as \"Latest\" (default: automatic based on date and version)") + release_createCmd.Flags().Bool("latest", false, "Mark this release as \"Latest\" (default [automatic based on date and version])") release_createCmd.Flags().StringP("notes", "n", "", "Release notes") release_createCmd.Flags().StringP("notes-file", "F", "", "Read release notes from `file` (use \"-\" to read from standard input)") release_createCmd.Flags().Bool("notes-from-tag", false, "Automatically generate notes from annotated tag") release_createCmd.Flags().String("notes-start-tag", "", "Tag to use as the starting point for generating release notes") release_createCmd.Flags().BoolP("prerelease", "p", false, "Mark the release as a prerelease") - release_createCmd.Flags().String("target", "", "Target `branch` or full commit SHA (default: main branch)") + release_createCmd.Flags().String("target", "", "Target `branch` or full commit SHA (default [main branch])") release_createCmd.Flags().StringP("title", "t", "", "Release title") release_createCmd.Flags().Bool("verify-tag", false, "Abort in case the git tag doesn't already exist in the remote repository") releaseCmd.AddCommand(release_createCmd) diff --git a/completers/gh_completer/cmd/release_edit.go b/completers/gh_completer/cmd/release_edit.go index 1dac33a4b4..e358f64ab3 100644 --- a/completers/gh_completer/cmd/release_edit.go +++ b/completers/gh_completer/cmd/release_edit.go @@ -23,7 +23,7 @@ func init() { release_editCmd.Flags().StringP("notes-file", "F", "", "Read release notes from `file` (use \"-\" to read from standard input)") release_editCmd.Flags().Bool("prerelease", false, "Mark the release as a prerelease") release_editCmd.Flags().String("tag", "", "The name of the tag") - release_editCmd.Flags().String("target", "", "Target `branch` or full commit SHA (default: main branch)") + release_editCmd.Flags().String("target", "", "Target `branch` or full commit SHA (default [main branch])") release_editCmd.Flags().StringP("title", "t", "", "Release title") release_editCmd.Flags().Bool("verify-tag", false, "Abort in case the git tag doesn't already exist in the remote repository") releaseCmd.AddCommand(release_editCmd) diff --git a/completers/gh_completer/cmd/release_list.go b/completers/gh_completer/cmd/release_list.go index 470724734c..5456afba0b 100644 --- a/completers/gh_completer/cmd/release_list.go +++ b/completers/gh_completer/cmd/release_list.go @@ -3,6 +3,7 @@ package cmd import ( "github.com/rsteube/carapace" "github.com/rsteube/carapace-bin/pkg/actions/tools/gh" + "github.com/rsteube/carapace/pkg/style" "github.com/spf13/cobra" ) @@ -22,10 +23,12 @@ func init() { release_listCmd.Flags().StringP("jq", "q", "", "Filter JSON output using a jq `expression`") release_listCmd.Flags().StringSlice("json", []string{}, "Output JSON with the specified `fields`") release_listCmd.Flags().StringP("limit", "L", "", "Maximum number of items to fetch") + release_listCmd.Flags().StringP("order", "O", "", "Order of releases returned: {asc|desc}") release_listCmd.Flags().StringP("template", "t", "", "Format JSON output using a Go template; see \"gh help formatting\"") releaseCmd.AddCommand(release_listCmd) carapace.Gen(release_listCmd).FlagCompletion(carapace.ActionMap{ - "json": gh.ActionReleaseFields().UniqueList(","), + "json": gh.ActionReleaseFields().UniqueList(","), + "order": carapace.ActionValues("asc", "desc").StyleF(style.ForKeyword), }) } diff --git a/completers/gh_completer/cmd/repo_sync.go b/completers/gh_completer/cmd/repo_sync.go index 45fb3b1efa..2216d89428 100644 --- a/completers/gh_completer/cmd/repo_sync.go +++ b/completers/gh_completer/cmd/repo_sync.go @@ -16,7 +16,7 @@ var repo_syncCmd = &cobra.Command{ func init() { carapace.Gen(repo_syncCmd).Standalone() - repo_syncCmd.Flags().StringP("branch", "b", "", "Branch to sync (default: default branch)") + repo_syncCmd.Flags().StringP("branch", "b", "", "Branch to sync (default [default branch])") repo_syncCmd.Flags().Bool("force", false, "Hard reset the branch of the destination repository to match the source repository") repo_syncCmd.Flags().StringP("source", "s", "", "Source repository") repoCmd.AddCommand(repo_syncCmd)