-
-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathrepo_edit.go
More file actions
67 lines (61 loc) · 3.81 KB
/
repo_edit.go
File metadata and controls
67 lines (61 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/common/gh_completer/cmd/action"
"github.com/spf13/cobra"
)
var repo_editCmd = &cobra.Command{
Use: "edit [<repository>]",
Short: "Edit repository settings",
GroupID: "Targeted commands",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(repo_editCmd).Standalone()
repo_editCmd.Flags().Bool("accept-visibility-change-consequences", false, "Accept the consequences of changing the repository visibility")
repo_editCmd.Flags().StringSlice("add-topic", nil, "Add repository topic")
repo_editCmd.Flags().Bool("allow-forking", false, "Allow forking of an organization repository")
repo_editCmd.Flags().Bool("allow-update-branch", false, "Allow a pull request head branch that is behind its base branch to be updated")
repo_editCmd.Flags().String("default-branch", "", "Set the default branch `name` for the repository")
repo_editCmd.Flags().Bool("delete-branch-on-merge", false, "Delete head branch when pull requests are merged")
repo_editCmd.Flags().StringP("description", "d", "", "Description of the repository")
repo_editCmd.Flags().Bool("enable-advanced-security", false, "Enable advanced security in the repository")
repo_editCmd.Flags().Bool("enable-auto-merge", false, "Enable auto-merge functionality")
repo_editCmd.Flags().Bool("enable-discussions", false, "Enable discussions in the repository")
repo_editCmd.Flags().Bool("enable-issues", false, "Enable issues in the repository")
repo_editCmd.Flags().Bool("enable-merge-commit", false, "Enable merging pull requests via merge commit")
repo_editCmd.Flags().Bool("enable-projects", false, "Enable projects in the repository")
repo_editCmd.Flags().Bool("enable-rebase-merge", false, "Enable merging pull requests via rebase")
repo_editCmd.Flags().Bool("enable-secret-scanning", false, "Enable secret scanning in the repository")
repo_editCmd.Flags().Bool("enable-secret-scanning-push-protection", false, "Enable secret scanning push protection in the repository. Secret scanning must be enabled first")
repo_editCmd.Flags().Bool("enable-squash-merge", false, "Enable merging pull requests via squashed commit")
repo_editCmd.Flags().Bool("enable-wiki", false, "Enable wiki in the repository")
repo_editCmd.Flags().StringP("homepage", "h", "", "Repository home page `URL`")
repo_editCmd.Flags().StringSlice("remove-topic", nil, "Remove repository topic")
repo_editCmd.Flags().String("squash-merge-commit-message", "", "The default value for a squash merge commit message: {default|pr-title|pr-title-commits|pr-title-description}")
repo_editCmd.Flags().Bool("template", false, "Make the repository available as a template repository")
repo_editCmd.Flags().String("visibility", "", "Change the visibility of the repository to {public,private,internal}")
repoCmd.AddCommand(repo_editCmd)
carapace.Gen(repo_editCmd).FlagCompletion(carapace.ActionMap{
"add-topic": action.ActionTopicSearch(repo_editCmd),
"default-branch": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
if len(c.Args) > 0 {
repo_editCmd.Flags().String("repo", c.Args[0], "")
repo_editCmd.Flag("repo").Changed = true
}
return action.ActionBranches(repo_editCmd)
}),
"remove-topic": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
if len(c.Args) > 0 {
repo_editCmd.Flags().String("repo", c.Args[0], "")
repo_editCmd.Flag("repo").Changed = true
}
return action.ActionRepoTopics(repo_editCmd).UniqueList(",")
}),
"squash-merge-commit-message": carapace.ActionValues("default", "pr-title", "pr-title-commits", "pr-title-description"),
"visibility": carapace.ActionValues("public", "private", "internal"),
})
carapace.Gen(repo_editCmd).PositionalCompletion(
action.ActionOwnerRepositories(repo_editCmd),
)
}