mirror of
https://gitea.com/gitea/tea.git
synced 2026-06-06 03:08:44 +02:00
28ba9b915b
Reviewed-on: https://gitea.com/gitea/tea/pulls/1006 Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com>
31 lines
540 B
Go
31 lines
540 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package print
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"gitea.dev/sdk"
|
|
)
|
|
|
|
// LabelsList prints a listing of labels
|
|
func LabelsList(labels []*gitea.Label, output string) error {
|
|
t := tableWithHeader(
|
|
"Index",
|
|
"Color",
|
|
"Name",
|
|
"Description",
|
|
)
|
|
|
|
for _, label := range labels {
|
|
t.addRow(
|
|
strconv.FormatInt(label.ID, 10),
|
|
formatLabel(label, !isMachineReadable(output), label.Color),
|
|
label.Name,
|
|
label.Description,
|
|
)
|
|
}
|
|
return t.print(output)
|
|
}
|