Skip to content

Commit

Permalink
feat(player): show aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
crispgm committed Dec 11, 2023
1 parent 34ad11c commit 6c0d070
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/kicker-cli/cmd/player.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cmd

import (
"strings"

"github.com/pterm/pterm"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -32,7 +34,7 @@ func listPlayerCommand(cmd *cobra.Command, args []string) {
instance := initInstanceAndLoadConf()
// load tournaments
var table [][]string
header := []string{"ID", "Name", "ITSF_ID", "ATSA_ID"}
header := []string{"ID", "Name", "ITSF_ID", "ATSA_ID", "A.K.A"}
if !globalNoHeaders {
table = append(table, header)
}
Expand All @@ -46,8 +48,9 @@ func listPlayerCommand(cmd *cobra.Command, args []string) {
table = append(table, []string{
p.ID,
p.Name,
p.ITSFID,
p.ATSAID,
dashIfEmpty(p.ITSFID),
dashIfEmpty(p.ATSAID),
dashIfEmpty(strings.Join(p.Aliases, ", ")),
})
}
_ = pterm.DefaultTable.WithHasHeader(!globalNoHeaders).WithData(table).WithBoxed(!globalNoBoxes).Render()
Expand Down

0 comments on commit 6c0d070

Please sign in to comment.