0
0
forked from toolshed/abra

refactor: formatter gets own package

This commit is contained in:
2021-12-28 01:24:23 +01:00
parent 07119b0575
commit f5d2d3adf6
23 changed files with 42 additions and 42 deletions

View File

@ -4,14 +4,14 @@ import (
"strings"
"time"
abraFormatter "coopcloud.tech/abra/cli/formatter"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/autocomplete"
"coopcloud.tech/abra/pkg/client"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/formatter"
stack "coopcloud.tech/abra/pkg/upstream/stack"
"github.com/buger/goterm"
"github.com/docker/cli/cli/command/formatter"
dockerFormatter "github.com/docker/cli/cli/command/formatter"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
dockerClient "github.com/docker/docker/client"
@ -71,7 +71,7 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) {
}
tableCol := []string{"image", "created", "status", "state", "ports"}
table := abraFormatter.CreateTable(tableCol)
table := formatter.CreateTable(tableCol)
for _, container := range containers {
var containerNames []string
@ -81,11 +81,11 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) {
}
tableRow := []string{
abraFormatter.RemoveSha(container.Image),
abraFormatter.HumanDuration(container.Created),
formatter.RemoveSha(container.Image),
formatter.HumanDuration(container.Created),
container.Status,
container.State,
formatter.DisplayablePorts(container.Ports),
dockerFormatter.DisplayablePorts(container.Ports),
}
table.Append(tableRow)
}