Add --fields
to notification & milestone listings #422
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
var fieldsFlag = flags.FieldsFlag(print.MilestoneFields, []string{
|
||||
"title", "open/closed issues", "due date",
|
||||
"title", "items", "duedate",
|
||||
})
|
||||
|
||||
// CmdMilestonesList represents a sub command of milestones to list milestones
|
||||
|
|
|
@ -38,10 +38,10 @@ func MilestonesList(news []*gitea.Milestone, output string, fields []string) {
|
|||
var MilestoneFields = []string{
|
||||
"title",
|
||||
"state",
|
||||
"open items",
|
||||
"closed items",
|
||||
"open/closed issues",
|
||||
"due date",
|
||||
"items_open",
|
||||
"items_closed",
|
||||
"items",
|
||||
6543 marked this conversation as resolved
Outdated
|
||||
"duedate",
|
||||
"description",
|
||||
"created",
|
||||
"updated",
|
||||
|
@ -59,13 +59,13 @@ func (m printableMilestone) FormatField(field string, machineReadable bool) stri
|
|||
return m.Title
|
||||
case "state":
|
||||
return string(m.State)
|
||||
case "open items":
|
||||
case "items_open":
|
||||
return fmt.Sprintf("%d", m.OpenIssues)
|
||||
case "closed items":
|
||||
case "items_closed":
|
||||
return fmt.Sprintf("%d", m.ClosedIssues)
|
||||
case "open/closed issues": // for backwards compatibility
|
||||
case "items":
|
||||
return fmt.Sprintf("%d/%d", m.OpenIssues, m.ClosedIssues)
|
||||
case "deadline", "due date":
|
||||
case "duedate":
|
||||
if m.Deadline != nil && !m.Deadline.IsZero() {
|
||||
return FormatTime(*m.Deadline)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user
not sure if these long and spaced column names are good, they are a not easy to apply:
will see if I can come up with better values
agree 👍 - rest looks ready :)
@6543 I finally simplified the field names. I'm not exactly happy with the result, but it's good enough I guess.
This makes the PR breaking though, as we don't return the same fields anymore.