Add milestones subcomand (#149)

issues/pulls show milestones

add mile issues subsubcomand

Add milestones subcomand

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/149
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
6543
2020-09-17 19:35:24 +00:00
parent e4d7a77348
commit 7c30579900
5 changed files with 478 additions and 14 deletions

View File

@@ -62,10 +62,11 @@ func runPulls(ctx *cli.Context) error {
headers := []string{
"Index",
"Title",
"State",
"Author",
"Milestone",
"Updated",
"Title",
}
var values [][]string
@@ -79,18 +80,23 @@ func runPulls(ctx *cli.Context) error {
if pr == nil {
continue
}
name := pr.Poster.FullName
if len(name) == 0 {
name = pr.Poster.UserName
author := pr.Poster.FullName
if len(author) == 0 {
author = pr.Poster.UserName
}
mile := ""
if pr.Milestone != nil {
mile = pr.Milestone.Title
}
values = append(
values,
[]string{
strconv.FormatInt(pr.Index, 10),
string(pr.State),
name,
pr.Updated.Format("2006-01-02 15:04:05"),
pr.Title,
string(pr.State),
author,
mile,
pr.Updated.Format("2006-01-02 15:04:05"),
},
)
}