Skip to content

Commit 0cdc700

Browse files
authored
Merge pull request #3059 from carapace-sh/gh-updates-v2.83.0
gh: updates from v2.83.0
2 parents f84ea4c + 613bfd2 commit 0cdc700

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

completers/common/gh_completer/cmd/agentTask_create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ func init() {
1616
carapace.Gen(agentTask_createCmd).Standalone()
1717

1818
agentTask_createCmd.Flags().StringP("base", "b", "", "Base branch for the pull request (use default branch if not provided)")
19+
agentTask_createCmd.Flags().StringP("custom-agent", "a", "", "Use a custom agent for the task. e.g., use 'my-agent' for the 'my-agent.md' agent")
1920
agentTask_createCmd.Flags().Bool("follow", false, "Follow agent session logs")
2021
agentTask_createCmd.Flags().StringP("from-file", "F", "", "Read task description from `file` (use \"-\" to read from standard input)")
2122
agentTask_createCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `[HOST/]OWNER/REPO` format")

completers/common/gh_completer/cmd/api.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func init() {
1818
carapace.Gen(apiCmd).Standalone()
1919

2020
apiCmd.Flags().String("cache", "", "Cache the response, e.g. \"3600s\", \"60m\", \"1h\"")
21-
apiCmd.Flags().StringSliceP("field", "F", nil, "Add a typed parameter in `key=value` format")
21+
apiCmd.Flags().StringSliceP("field", "F", nil, "Add a typed parameter in `key=value` format (use \"@<path>\" or \"@-\" to read value from file or stdin)")
2222
apiCmd.Flags().StringSliceP("header", "H", nil, "Add a HTTP request header in `key:value` format")
2323
apiCmd.Flags().String("hostname", "", "The GitHub hostname for the request (default \"github.com\")")
2424
apiCmd.Flags().BoolP("include", "i", false, "Include HTTP response status line and headers in the output")
@@ -35,6 +35,12 @@ func init() {
3535
rootCmd.AddCommand(apiCmd)
3636

3737
carapace.Gen(apiCmd).FlagCompletion(carapace.ActionMap{
38+
"field": carapace.ActionMultiPartsN("=", 2, func(c carapace.Context) carapace.Action {
39+
if len(c.Parts) == 0 {
40+
return carapace.ActionValues()
41+
}
42+
return carapace.ActionFiles().Prefix("@")
43+
}),
3844
"header": http.ActionRequestHeaders(),
3945
"hostname": action.ActionConfigHosts(),
4046
"input": carapace.ActionFiles(),

completers/common/gh_completer/cmd/pr_checks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func init() {
1717
carapace.Gen(pr_checksCmd).Standalone()
1818

1919
pr_checksCmd.Flags().Bool("fail-fast", false, "Exit watch mode on first check failure")
20-
pr_checksCmd.Flags().StringP("interval", "i", "", "Refresh interval in seconds when using `--watch` flag")
20+
pr_checksCmd.Flags().StringP("interval", "i", "", "Refresh interval in seconds in watch mode")
2121
pr_checksCmd.Flags().StringP("jq", "q", "", "Filter JSON output using a jq `expression`")
2222
pr_checksCmd.Flags().StringSlice("json", nil, "Output JSON with the specified `fields`")
2323
pr_checksCmd.Flags().Bool("required", false, "Only show checks that are required")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/carapace-sh/carapace-bin/completers/common/gh_completer/cmd/action"
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var pr_revertCmd = &cobra.Command{
10+
Use: "revert {<number> | <url> | <branch>}",
11+
Short: "Revert a pull request",
12+
GroupID: "Targeted commands",
13+
Run: func(cmd *cobra.Command, args []string) {},
14+
}
15+
16+
func init() {
17+
carapace.Gen(pr_revertCmd).Standalone()
18+
19+
pr_revertCmd.Flags().StringP("body", "b", "", "Body for the revert pull request")
20+
pr_revertCmd.Flags().StringP("body-file", "F", "", "Read body text from `file` (use \"-\" to read from standard input)")
21+
pr_revertCmd.Flags().BoolP("draft", "d", false, "Mark revert pull request as a draft")
22+
pr_revertCmd.Flags().StringP("title", "t", "", "Title for the revert pull request")
23+
prCmd.AddCommand(pr_revertCmd)
24+
25+
carapace.Gen(pr_revertCmd).FlagCompletion(carapace.ActionMap{
26+
"body-file": carapace.ActionFiles(),
27+
})
28+
29+
carapace.Gen(pr_revertCmd).PositionalCompletion(
30+
action.ActionPullRequests(pr_revertCmd, action.PullRequestOpts{Merged: true}),
31+
)
32+
33+
}

0 commit comments

Comments
 (0)