fix: make ps a bit more useful and less verbose
This commit is contained in:
parent
ca16c002ba
commit
454ee696d6
|
@ -35,18 +35,22 @@ var appPsCommand = &cli.Command{
|
|||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
tableCol := []string{"id", "image", "command", "created", "status", "ports", "names"}
|
||||
tableCol := []string{"image", "created", "status", "ports", "names"}
|
||||
table := abraFormatter.CreateTable(tableCol)
|
||||
|
||||
for _, container := range containers {
|
||||
var containerNames []string
|
||||
for _, containerName := range container.Names {
|
||||
trimmed := strings.TrimPrefix(containerName, "/")
|
||||
containerNames = append(containerNames, trimmed)
|
||||
}
|
||||
|
||||
tableRow := []string{
|
||||
abraFormatter.ShortenID(container.ID),
|
||||
abraFormatter.RemoveSha(container.Image),
|
||||
abraFormatter.Truncate(container.Command),
|
||||
abraFormatter.HumanDuration(container.Created),
|
||||
container.Status,
|
||||
formatter.DisplayablePorts(container.Ports),
|
||||
strings.Join(container.Names, ", "),
|
||||
strings.Join(containerNames, "\n"),
|
||||
}
|
||||
table.Append(tableRow)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue