-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflag.go
108 lines (93 loc) · 2.67 KB
/
flag.go
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package main
type Args struct {
Token string `arg:"env:GITHUB_TOKEN,required"`
Org string `arg:"env:GITHUB_ORG,required"`
OutputFormat string `arg:"-o" help:"output format: normal, json" default:"normal"`
Verbose bool `arg:"-v" default:"false"`
Get *Get `arg:"subcommand:get"`
Create *Create `arg:"subcommand:create"`
Add *Add `arg:"subcommand:add"`
Update *Create `arg:"subcommand:update"`
Apply *Apply `arg:"subcommand:apply"`
}
func (Args) Version() string {
return "0.5.1"
}
type Get struct {
Repos *Repos `arg:"subcommand:repos"`
Members *Members `arg:"subcommand:members"`
Teams *Teams `arg:"subcommand:teams"`
}
type Repos struct {
RepoName *string `arg:"positional"`
}
type Members struct {
}
type Teams struct {
TeamName *string `arg:"positional"`
}
type Create struct {
Repo *Repo `arg:"subcommand:repo"`
Branch *Branch `arg:"subcommand:branch"`
Protection *Protection `arg:"subcommand:protection"`
}
type Repo struct {
Name *string `arg:"-n,required"`
Description *string `arg:"-d"`
Homepage *string `arg:"-h"`
Private *bool
NoIssues *bool
NoProjects *bool
NoWiki *bool
AutoInit *bool `arg:"-a"`
GitignoreTemplate *string `arg:"-i"`
LicenseTemplate *string `arg:"-l"`
NoMergeCommit *bool
NoSquashMerge *bool
NoRebaseMerge *bool
DefaultBranch *string
DeleteBranchOnMerge *bool
}
type Branch struct {
Repo string `arg:"-r,required"`
Branch string `arg:"-b,required"`
}
type Protection struct {
Repo string `arg:"-r,required"`
Branch string `arg:"-b,required"`
MinApprove int `arg:"-p"`
DismissStaleReviews bool `arg:"-d"`
CanDismiss string
CanDismissTeams string
RequireBranchesUpToDate bool
CodeOwner bool `arg:"-c"`
IncludeAdmins bool `arg:"-a"`
CanPush string
CanPushTeams string
RequiredStatusChecks string `arg:"-s,--required-status-checks"`
}
type Add struct {
File *File `arg:"subcommand:file"`
Collaborator *Collaborator `arg:"subcommand:collaborator"`
Team *Team `arg:"subcommand:team"`
}
type File struct {
Repo string `arg:"-r,required"`
Branch string `arg:"-b,required"`
File string `arg:"-f,required"`
GitEmail string `arg:"-e,required"`
CommitMessage string `arg:"-m,--gitmessage"`
}
type Collaborator struct {
Repo string `arg:"-r,required"`
User string `arg:"-u,required"`
Permission string `arg:"-p,required"`
}
type Team struct {
Repo string `arg:"-r,required"`
Team string `arg:"-t,required"`
Permission string `arg:"-p,required"`
}
type Apply struct {
FileName string `arg:"-f,required"`
}