@@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"fmt"
5
+ "os"
5
6
6
7
"github.com/yeqown/gitlab-flow/internal/types"
7
8
@@ -21,26 +22,27 @@ func getDashFeatureDetailSubCommand() *cli.Command {
21
22
return & cli.Command {
22
23
Name : "feature" ,
23
24
Aliases : []string {"f" },
24
- Usage : "overview of one feature of current project." ,
25
- ArgsUsage : "-fb , --feature_branch_name `BranchName`" ,
25
+ Usage : "overview of the feature of current project." ,
26
+ ArgsUsage : "-b , --branch_name `BranchName`" ,
26
27
Category : "dash" ,
27
28
Flags : []cli.Flag {
28
29
& cli.StringFlag {
29
- Name : "feature_branch_name" ,
30
- Aliases : []string {"fb" },
31
- Usage : "input the target branch name" ,
32
- Required : false ,
30
+ Name : "branch_name" ,
31
+ Aliases : []string {"b" },
32
+ Usage : "input the target `BranchName`" ,
33
+ DefaultText : "current branch" ,
34
+ Required : false ,
33
35
},
34
36
},
35
37
Action : func (c * cli.Context ) error {
36
38
confPath := c .String ("conf_path" )
37
39
debug := c .Bool ("debug" )
38
- featureBranchName := c .String ("branchName " )
40
+ featureBranchName := c .String ("branch_name " )
39
41
data , err := getDash (confPath , debug ).FeatureDetail (featureBranchName )
40
42
if err != nil {
41
43
return err
42
44
}
43
- fmt .Printf ( "%s\n " , data )
45
+ _ , _ = fmt .Fprintf ( os . Stdout , "%s\n " , data )
44
46
return nil
45
47
},
46
48
}
@@ -52,32 +54,32 @@ func getDashMilestoneOverviewSubCommand() *cli.Command {
52
54
Name : "milestone" ,
53
55
Aliases : []string {"m" },
54
56
Usage : "overview of one milestone, includes: merges, issues, branch" ,
55
- ArgsUsage : "@milestoneName " ,
57
+ ArgsUsage : "-m, --milestone_name -b --branch_name " ,
56
58
Category : "dash" ,
57
59
Flags : []cli.Flag {
58
60
& cli.StringFlag {
59
61
Name : "milestone_name" ,
60
62
Aliases : []string {"m" },
61
- Usage : "-m, --milestone_name " ,
63
+ Usage : "input `milestoneName` which you want to get its information " ,
62
64
Required : true ,
63
65
},
64
66
& cli.StringFlag {
65
- Name : "filter_branch " ,
66
- Aliases : []string {"f " },
67
- Usage : "-f, --filter_branch @ branchName default: master " ,
67
+ Name : "branch_name " ,
68
+ Aliases : []string {"b " },
69
+ Usage : "filter ` branchName` " ,
68
70
DefaultText : types .MasterBranch .String (),
69
71
},
70
72
},
71
73
Action : func (c * cli.Context ) error {
72
74
milestoneName := c .String ("milestone_name" )
73
- filterBranchName := c .String ("filter_branch " )
75
+ filterBranchName := c .String ("branch_name " )
74
76
confPath := c .String ("conf_path" )
75
77
debug := c .Bool ("debug" )
76
78
data , err := getDash (confPath , debug ).MilestoneOverview (milestoneName , filterBranchName )
77
79
if err != nil {
78
80
return err
79
81
}
80
- fmt .Printf ( "%s\n " , data )
82
+ _ , _ = fmt .Fprintf ( os . Stdout , "%s\n " , data )
81
83
return nil
82
84
},
83
85
}
@@ -86,29 +88,19 @@ func getDashMilestoneOverviewSubCommand() *cli.Command {
86
88
// gitlab-flow dash project
87
89
func getDashProjectDetailSubCommand () * cli.Command {
88
90
return & cli.Command {
89
- Name : "project" ,
90
- Aliases : []string {"p" },
91
- Usage : "-p, --project" ,
92
- ArgsUsage : "-p @projectName, default current project" ,
93
- Category : "dash" ,
94
- Flags : []cli.Flag {
95
- & cli.BoolFlag {
96
- Name : "open_web" ,
97
- Aliases : []string {"o" },
98
- Usage : "-o, --open_web" ,
99
- Required : false ,
100
- Value : false ,
101
- },
102
- },
91
+ Name : "project" ,
92
+ Aliases : []string {"p" },
93
+ Usage : "do something of current project." ,
94
+ Category : "dash" ,
95
+ //Flags: []cli.Flag{},
103
96
Action : func (c * cli.Context ) error {
104
97
confPath := c .String ("conf_path" )
105
98
debug := c .Bool ("debug" )
106
- open := c .Bool ("open_web" )
107
- data , err := getDash (confPath , debug ).ProjectDetail (open )
99
+ data , err := getDash (confPath , debug ).ProjectDetail ()
108
100
if err != nil {
109
101
return err
110
102
}
111
- fmt .Printf ( "%s\n " , data )
103
+ _ , _ = fmt .Fprintf ( os . Stdout , "%s\n " , data )
112
104
return nil
113
105
},
114
106
}
0 commit comments