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.
Copy file name to clipboardExpand all lines: commands/mr/flag.go
+53-10
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
package mr
2
2
3
3
import (
4
+
"fmt"
5
+
4
6
flags "github.com/jessevdk/go-flags"
5
7
"github.com/lighttiger2505/lab/commands/internal"
6
8
"github.com/lighttiger2505/lab/internal/config"
@@ -15,15 +17,17 @@ type Option struct {
15
17
}
16
18
17
19
typeCreateUpdateOptionstruct {
18
-
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."`
19
-
Titlestring`short:"i" long:"title" value-name:"<title>" description:"The title of an merge request"`
20
-
Messagestring`short:"m" long:"message" value-name:"<message>" description:"The message of an merge request"`
21
-
Templatestring`short:"p" long:"template" value-name:"<merge request template>" description:"Start the editor with file using merge request template"`
StateEventstring`long:"state-event" value-name:"<state>" description:"Change the status. \"opened\", \"closed\""`
25
-
AssigneeIDint`long:"cu-assignee-id" value-name:"<assignee id>" description:"The ID of the user to assign the merge request to. If default_assignee_id is set in config, it is automatically entered"`
26
-
MilestoneIDint`long:"cu-milestone-id" value-name:"<milestone id>" description:"The global ID of a milestone to assign the merge request to. "`
20
+
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."`
21
+
Titlestring`short:"i" long:"title" value-name:"<title>" description:"The title of an merge request"`
22
+
Messagestring`short:"m" long:"message" value-name:"<message>" description:"The message of an merge request"`
23
+
Templatestring`short:"p" long:"template" value-name:"<merge request template>" description:"Start the editor with file using merge request template"`
StateEventstring`long:"state-event" value-name:"<state>" description:"Change the status. \"opened\", \"closed\""`
27
+
AssigneeIDint`long:"cu-assignee-id" value-name:"<assignee id>" description:"The ID of the user to assign the merge request to. If default_assignee_id is set in config, it is automatically entered"`
28
+
MilestoneIDint`long:"cu-milestone-id" value-name:"<milestone id>" description:"The global ID of a milestone to assign the merge request to. "`
29
+
RemoveSourceBranchstring`long:"remove-source-branch" value-name:"<true/false>" description:"Merge request should remove the source branch when merging"`
30
+
Squashstring`long:"squash" value-name:"<true/false>" description:"Squash commits into a single commit when merging"`
27
31
}
28
32
29
33
func (o*CreateUpdateOption) hasEdit() bool {
@@ -47,7 +51,9 @@ func (o *CreateUpdateOption) hasUpdate() bool {
47
51
o.Message!=""||
48
52
o.StateEvent!=""||
49
53
o.AssigneeID!=0||
50
-
o.MilestoneID!=0 {
54
+
o.MilestoneID!=0||
55
+
o.RemoveSourceBranch!=""||
56
+
o.Squash!="" {
51
57
returntrue
52
58
}
53
59
returnfalse
@@ -63,6 +69,43 @@ func (o *CreateUpdateOption) getAssigneeID(profile *config.Profile) int {
Numint`short:"n" long:"num" value-name:"<num>" default:"20" default-mask:"20" description:"Limit the number of merge request to output."`
68
111
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\""`
0 commit comments