Skip to content

Commit

Permalink
fix automerge for --wide option (#2339)
Browse files Browse the repository at this point in the history
  • Loading branch information
toweber authored Dec 9, 2024
1 parent 393eec5 commit 59ad3bc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions cmd/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ func printContainerInspect(containers []runtime.GenericContainer, format string)

if wide {
header = slices.Insert(header, 1, "Owner")
table.SetColumnConfigs([]tableWriter.ColumnConfig{
{Number: 1, AutoMerge: true},
})
}

if all {
Expand All @@ -276,16 +279,19 @@ func printContainerInspect(containers []runtime.GenericContainer, format string)
{Number: 2, AutoMerge: true},
})
table.AppendHeader(append(tableWriter.Row{"Topology"}, header...))

if wide {
table.SetColumnConfigs([]tableWriter.ColumnConfig{
{Number: 1, AutoMerge: true},
{Number: 2, AutoMerge: true},
{Number: 3, AutoMerge: true},
})
}

} else {
table.AppendHeader(append(tableWriter.Row{}, header[1:]...))
}

if wide {
table.SetColumnConfigs([]tableWriter.ColumnConfig{
{Number: 2, AutoMerge: true},
})
}

table.AppendRows(tabData)

table.Render()
Expand Down

0 comments on commit 59ad3bc

Please sign in to comment.