@@ -10,6 +10,8 @@ import (
1010 "strconv"
1111
1212 "github.com/olekukonko/tablewriter"
13+ "github.com/olekukonko/tablewriter/renderer"
14+ "github.com/olekukonko/tablewriter/tw"
1315 "github.com/spf13/cobra"
1416
1517 "github.com/oasisprotocol/oasis-core/go/common/crypto/signature"
@@ -489,12 +491,42 @@ func (s *runtimeStats) printStats() {
489491
490492func (s * runtimeStats ) printEntityStats () {
491493 fmt .Println ("\n === ENTITY STATISTICS ===" )
492- table := tablewriter .NewWriter (os .Stdout )
493- table .SetBorders (tablewriter.Border {Left : true , Top : false , Right : true , Bottom : false })
494- table .SetCenterSeparator ("|" )
495- table .SetHeader (s .entitiesHeader )
496- table .AppendBulk (s .entitiesOutput )
497- table .Render ()
494+
495+ // Configure table with left/right borders, no top/bottom borders, and pipe separators.
496+ rendition := tw.Rendition {
497+ Borders : tw.Border {
498+ Left : tw .On ,
499+ Right : tw .On ,
500+ Top : tw .Off ,
501+ Bottom : tw .Off ,
502+ },
503+ Symbols : tw .NewSymbols (tw .StyleASCII ),
504+ Settings : tw.Settings {
505+ Separators : tw.Separators {
506+ BetweenColumns : tw .On ,
507+ },
508+ },
509+ }
510+
511+ table := tablewriter .NewTable (
512+ os .Stdout ,
513+ tablewriter .WithRenderer (renderer .NewBlueprint (rendition )),
514+ tablewriter .WithConfig (tablewriter.Config {
515+ Row : tw.CellConfig {
516+ Formatting : tw.CellFormatting {
517+ AutoWrap : tw .WrapNormal ,
518+ },
519+ },
520+ }),
521+ )
522+ // Convert []string to []any for Header.
523+ headerAny := make ([]any , len (s .entitiesHeader ))
524+ for i , v := range s .entitiesHeader {
525+ headerAny [i ] = v
526+ }
527+ table .Header (headerAny ... )
528+ cobra .CheckErr (table .Bulk (s .entitiesOutput ))
529+ cobra .CheckErr (table .Render ())
498530}
499531
500532func init () {
0 commit comments