@@ -203,7 +203,7 @@ func (stats serverStats) render() {
203203
204204 table .SetHeader ([]string {"Server" , "Address" , "Service" , "Config" , "Value" })
205205 table .SetAlignment (tablewriter .ALIGN_LEFT )
206- table .SetColWidth (100 )
206+ table .SetColWidth (40 )
207207
208208 // Find the longest lines for all columns for the hacked separator
209209 separator := make ([]string , 5 )
@@ -222,8 +222,10 @@ func (stats serverStats) render() {
222222 if len (config ) > len (separator [3 ]) {
223223 separator [3 ] = strings .Repeat ("-" , len (config ))
224224 }
225- if len (value ) > len (separator [4 ]) {
226- separator [4 ] = strings .Repeat ("-" , len (value ))
225+ for _ , val := range strings .Split (value , "\n " ) {
226+ if len (val ) > len (separator [4 ]) {
227+ separator [4 ] = strings .Repeat ("-" , len (val ))
228+ }
227229 }
228230 }
229231 }
@@ -263,13 +265,17 @@ func (stats serverStats) render() {
263265 sort .Strings (configs )
264266
265267 for k , config := range configs {
266- switch {
267- case j == 0 && k == 0 :
268- table .Append ([]string {server , stats [server ].address , service , config , stats [server ].services [service ][config ]})
269- case k == 0 :
270- table .Append ([]string {"" , "" , service , config , stats [server ].services [service ][config ]})
271- default :
272- table .Append ([]string {"" , "" , "" , config , stats [server ].services [service ][config ]})
268+ for l , value := range strings .Split (stats [server ].services [service ][config ], "\n " ) {
269+ switch {
270+ case j == 0 && k == 0 && l == 0 :
271+ table .Append ([]string {server , stats [server ].address , service , config , value })
272+ case k == 0 && l == 0 :
273+ table .Append ([]string {"" , "" , service , config , value })
274+ case l == 0 :
275+ table .Append ([]string {"" , "" , "" , config , value })
276+ default :
277+ table .Append ([]string {"" , "" , "" , "" , value })
278+ }
273279 }
274280 }
275281 }
0 commit comments