forked from toolshed/abra
refactor: tablewriter -> lipgloss
Also the jsontable impl. is dropped also. Output is unchanged.
This commit is contained in:
@ -56,9 +56,15 @@ var appServicesCommand = cli.Command{
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
tableCol := []string{"service name", "image"}
|
||||
table := formatter.CreateTable(tableCol)
|
||||
table, err := formatter.CreateTable2()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
headers := []string{"SERVICE (SHORT)", "SERVICE (LONG)", "IMAGE"}
|
||||
table.Headers(headers...)
|
||||
|
||||
var rows [][]string
|
||||
for _, container := range containers {
|
||||
var containerNames []string
|
||||
for _, containerName := range container.Names {
|
||||
@ -69,14 +75,20 @@ var appServicesCommand = cli.Command{
|
||||
serviceShortName := service.ContainerToServiceName(container.Names, app.StackName())
|
||||
serviceLongName := fmt.Sprintf("%s_%s", app.StackName(), serviceShortName)
|
||||
|
||||
tableRow := []string{
|
||||
row := []string{
|
||||
serviceShortName,
|
||||
serviceLongName,
|
||||
formatter.RemoveSha(container.Image),
|
||||
}
|
||||
table.Append(tableRow)
|
||||
|
||||
rows = append(rows, row)
|
||||
}
|
||||
|
||||
table.Render()
|
||||
table.Rows(rows...)
|
||||
|
||||
if len(rows) > 0 {
|
||||
fmt.Println(table)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
Reference in New Issue
Block a user