You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2022. It is now read-only.
Editbool`short:"e" long:"edit" description:"Edit the merge request on editor. Start the editor with the contents in the given title and message options."`
18
+
Titlestring`short:"i" long:"title" value-name:"<title>" description:"The title of an merge request"`
19
+
Messagestring`short:"m" long:"message" value-name:"<message>" description:"The message of an merge request"`
20
+
Templatestring`short:"p" long:"template" value-name:"<merge request template>" description:"The template of an merge request"`
StateEventstring`long:"state-event" value-name:"<state>" description:"Change the status. \"opened\", \"closed\""`
24
+
AssigneeIDint`long:"cu-assignee-id" value-name:"<assignee id>" description:"The ID of assignee."`
25
+
MilestoneIDint`long:"cu-milestone-id" value-name:"<milestone id>" description:"The ID of milestone."`
26
+
}
27
+
28
+
func (o*CreateUpdateOption) hasEdit() bool {
29
+
ifo.Edit {
30
+
returntrue
31
+
}
32
+
returnfalse
33
+
}
34
+
35
+
func (o*CreateUpdateOption) hasCreate() bool {
36
+
ifo.Title!=""||
37
+
o.AssigneeID!=0||
38
+
o.MilestoneID!=0 {
39
+
returntrue
40
+
}
41
+
returnfalse
42
+
}
43
+
44
+
func (o*CreateUpdateOption) hasUpdate() bool {
45
+
ifo.Title!=""||
46
+
o.Message!=""||
47
+
o.StateEvent!=""||
48
+
o.AssigneeID!=0||
49
+
o.MilestoneID!=0 {
50
+
returntrue
51
+
}
52
+
returnfalse
53
+
}
54
+
55
+
typeListOptionstruct {
56
+
Numint`short:"n" long:"num" value-name:"<num>" default:"20" default-mask:"20" description:"Limit the number of merge request to output."`
57
+
Statestring`long:"state" value-name:"<state>" default:"all" default-mask:"all" description:"Print only merge request of the state just those that are \"opened\", \"closed\", \"merged\" or \"all\""`
58
+
Scopestring`long:"scope" value-name:"<scope>" default:"all" default-mask:"all" description:"Print only given scope. \"created-by-me\", \"assigned-to-me\" or \"all\"."`
59
+
OrderBystring`long:"orderby" value-name:"<orderby>" default:"updated_at" default-mask:"updated_at" description:"Print merge request ordered by \"created_at\" or \"updated_at\" fields."`
60
+
Sortstring`long:"sort" value-name:"<sort>" default:"desc" default-mask:"desc" description:"Print merge request ordered in \"asc\" or \"desc\" order."`
61
+
Searchstring`short:"s" long:"search" value-name:"<search word>" description:"Search merge request against their title and description."`
62
+
Milestonestring`long:"milestone" value-name:"<milestone>" description:"lists merge request that have an assigned milestone."`
63
+
AuthorIDint`long:"author-id" value-name:"<auther id>" description:"lists merge request that have an author id."`
64
+
AssigneeIDint`long:"assignee-id" value-name:"<assignee id>" description:"lists merge request that have an assignee id."`
65
+
Openedbool`short:"o" long:"opened" description:"Shorthand of the state option for \"--state=opened\"."`
66
+
Closedbool`short:"c" long:"closed" description:"Shorthand of the state option for \"--state=closed\"."`
67
+
Mergedbool`short:"g" long:"merged" description:"Shorthand of the state option for \"--state=merged\"."`
68
+
CreatedMebool`short:"r" long:"created-me" description:"Shorthand of the scope option for \"--scope=created-by-me\"."`
69
+
AssignedMebool`short:"a" long:"assigned-me" description:"Shorthand of the scope option for \"--scope=assigned-by-me\"."`
70
+
AllProjectbool`short:"A" long:"all-project" description:"Print the merge request of all projects"`
71
+
}
72
+
73
+
func (l*ListOption) getState() string {
74
+
ifl.Opened {
75
+
return"opened"
76
+
}
77
+
ifl.Closed {
78
+
return"closed"
79
+
}
80
+
ifl.Merged {
81
+
return"merged"
82
+
}
83
+
returnl.State
84
+
}
85
+
86
+
func (l*ListOption) getScope() string {
87
+
ifl.CreatedMe {
88
+
return"created-by-me"
89
+
}
90
+
ifl.AssignedMe {
91
+
return"assigned-to-me"
92
+
}
93
+
returnl.Scope
94
+
}
95
+
96
+
typeShowOptionstruct {
97
+
NoCommentbool`long:"no-comment" description:"Not print a list of comments for a spcific merge request."`
Copy file name to clipboardExpand all lines: commands/mr/mr.go
-126Lines changed: 0 additions & 126 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@ import (
5
5
"fmt"
6
6
"strconv"
7
7
8
-
flags "github.com/jessevdk/go-flags"
9
8
"github.com/lighttiger2505/lab/commands/internal"
10
9
"github.com/lighttiger2505/lab/git"
11
10
lab "github.com/lighttiger2505/lab/gitlab"
@@ -20,131 +19,6 @@ const (
20
19
ExitCodeFileErrorint=iota//2
21
20
)
22
21
23
-
typeCreateUpdateOptionstruct {
24
-
Editbool`short:"e" long:"edit" description:"Edit the merge request on editor. Start the editor with the contents in the given title and message options."`
25
-
Titlestring`short:"i" long:"title" value-name:"<title>" description:"The title of an merge request"`
26
-
Messagestring`short:"m" long:"message" value-name:"<message>" description:"The message of an merge request"`
27
-
Templatestring`short:"p" long:"template" value-name:"<merge request template>" description:"The template of an merge request"`
StateEventstring`long:"state-event" value-name:"<state>" description:"Change the status. \"opened\", \"closed\""`
31
-
AssigneeIDint`long:"cu-assignee-id" value-name:"<assignee id>" description:"The ID of assignee."`
32
-
MilestoneIDint`long:"cu-milestone-id" value-name:"<milestone id>" description:"The ID of milestone."`
33
-
}
34
-
35
-
func (o*CreateUpdateOption) hasEdit() bool {
36
-
ifo.Edit {
37
-
returntrue
38
-
}
39
-
returnfalse
40
-
}
41
-
42
-
func (o*CreateUpdateOption) hasCreate() bool {
43
-
ifo.Title!=""||
44
-
o.AssigneeID!=0||
45
-
o.MilestoneID!=0 {
46
-
returntrue
47
-
}
48
-
returnfalse
49
-
}
50
-
51
-
func (o*CreateUpdateOption) hasUpdate() bool {
52
-
ifo.Title!=""||
53
-
o.Message!=""||
54
-
o.StateEvent!=""||
55
-
o.AssigneeID!=0||
56
-
o.MilestoneID!=0 {
57
-
returntrue
58
-
}
59
-
returnfalse
60
-
}
61
-
62
-
typeListOptionstruct {
63
-
Numint`short:"n" long:"num" value-name:"<num>" default:"20" default-mask:"20" description:"Limit the number of merge request to output."`
64
-
Statestring`long:"state" value-name:"<state>" default:"all" default-mask:"all" description:"Print only merge request of the state just those that are \"opened\", \"closed\", \"merged\" or \"all\""`
65
-
Scopestring`long:"scope" value-name:"<scope>" default:"all" default-mask:"all" description:"Print only given scope. \"created-by-me\", \"assigned-to-me\" or \"all\"."`
66
-
OrderBystring`long:"orderby" value-name:"<orderby>" default:"updated_at" default-mask:"updated_at" description:"Print merge request ordered by \"created_at\" or \"updated_at\" fields."`
67
-
Sortstring`long:"sort" value-name:"<sort>" default:"desc" default-mask:"desc" description:"Print merge request ordered in \"asc\" or \"desc\" order."`
68
-
Searchstring`short:"s" long:"search" value-name:"<search word>" description:"Search merge request against their title and description."`
69
-
Milestonestring`long:"milestone" value-name:"<milestone>" description:"lists merge request that have an assigned milestone."`
70
-
AuthorIDint`long:"author-id" value-name:"<auther id>" description:"lists merge request that have an author id."`
71
-
AssigneeIDint`long:"assignee-id" value-name:"<assignee id>" description:"lists merge request that have an assignee id."`
72
-
Openedbool`short:"o" long:"opened" description:"Shorthand of the state option for \"--state=opened\"."`
73
-
Closedbool`short:"c" long:"closed" description:"Shorthand of the state option for \"--state=closed\"."`
74
-
Mergedbool`short:"g" long:"merged" description:"Shorthand of the state option for \"--state=merged\"."`
75
-
CreatedMebool`short:"r" long:"created-me" description:"Shorthand of the scope option for \"--scope=created-by-me\"."`
76
-
AssignedMebool`short:"a" long:"assigned-me" description:"Shorthand of the scope option for \"--scope=assigned-by-me\"."`
77
-
AllProjectbool`short:"A" long:"all-project" description:"Print the merge request of all projects"`
78
-
}
79
-
80
-
func (l*ListOption) getState() string {
81
-
ifl.Opened {
82
-
return"opened"
83
-
}
84
-
ifl.Closed {
85
-
return"closed"
86
-
}
87
-
ifl.Merged {
88
-
return"merged"
89
-
}
90
-
returnl.State
91
-
}
92
-
93
-
func (l*ListOption) getScope() string {
94
-
ifl.CreatedMe {
95
-
return"created-by-me"
96
-
}
97
-
ifl.AssignedMe {
98
-
return"assigned-to-me"
99
-
}
100
-
returnl.Scope
101
-
}
102
-
103
-
typeShowOptionstruct {
104
-
NoCommentbool`long:"no-comment" description:"Not print a list of comments for a spcific merge request."`
0 commit comments