Add --fields
to notification & milestone listings #422
|
@ -42,6 +42,11 @@ var MilestoneFields = []string{
|
|||
"closed items",
|
||||
"open/closed issues",
|
||||
6543 marked this conversation as resolved
Outdated
|
||||
"due date",
|
||||
"description",
|
||||
"created",
|
||||
"updated",
|
||||
"closed",
|
||||
"id",
|
||||
}
|
||||
|
||||
type printableMilestone struct {
|
||||
|
@ -60,10 +65,24 @@ func (m printableMilestone) FormatField(field string) string {
|
|||
return fmt.Sprintf("%d", m.ClosedIssues)
|
||||
case "open/closed issues": // for backwards compatibility
|
||||
return fmt.Sprintf("%d/%d", m.OpenIssues, m.ClosedIssues)
|
||||
case "due date":
|
||||
case "deadline", "due date":
|
||||
if m.Deadline != nil && !m.Deadline.IsZero() {
|
||||
return FormatTime(*m.Deadline)
|
||||
}
|
||||
case "id":
|
||||
return fmt.Sprintf("%d", m.ID)
|
||||
case "description":
|
||||
return m.Description
|
||||
case "created":
|
||||
return FormatTime(m.Created)
|
||||
case "updated":
|
||||
if m.Updated != nil {
|
||||
return FormatTime(*m.Updated)
|
||||
}
|
||||
case "closed":
|
||||
if m.Closed != nil {
|
||||
return FormatTime(*m.Closed)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
|
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.