@@ -575,20 +575,39 @@ impl CreateValidatorMulticastPublishersCommand {
575575 candidates. len( ) ,
576576 self . multicast_group,
577577 ) ;
578- eprintln ! (
579- " {:<44} {:<15} {:<24} {:<24} {:<20} {:>14}" ,
580- "OWNER" , "CLIENT IP" , "DEVICE" , "NEAREST DEVICE" , "CLIENT" , "STAKE (SOL)" ,
581- ) ;
582- eprintln ! ( " {}" , "-" . repeat( 150 ) ) ;
583- for c in & candidates {
584- let nearest = find_nearest_device_for_multicast ( & c. device_pk , & device_infos)
585- . map ( |d| d. code . clone ( ) )
586- . unwrap_or_else ( || "none" . to_string ( ) ) ;
587- eprintln ! (
588- " {:<44} {:<15} {:<24} {:<24} {:<20} {:>14.2}" ,
589- c. owner, c. client_ip, c. device_label, nearest, c. software_client, c. stake_sol,
590- ) ;
578+ #[ derive( Tabled , Serialize ) ]
579+ struct PlanRow {
580+ #[ tabled( rename = "OWNER" ) ]
581+ owner : String ,
582+ #[ tabled( rename = "CLIENT IP" ) ]
583+ client_ip : String ,
584+ #[ tabled( rename = "DEVICE" ) ]
585+ device : String ,
586+ #[ tabled( rename = "NEAREST DEVICE" ) ]
587+ nearest_device : String ,
588+ #[ tabled( rename = "CLIENT" ) ]
589+ client : String ,
590+ #[ tabled( rename = "STAKE (SOL)" ) ]
591+ stake_sol : String ,
591592 }
593+
594+ let plan_rows: Vec < PlanRow > = candidates
595+ . iter ( )
596+ . map ( |c| {
597+ let nearest = find_nearest_device_for_multicast ( & c. device_pk , & device_infos)
598+ . map ( |d| d. code . clone ( ) )
599+ . unwrap_or_else ( || "none" . to_string ( ) ) ;
600+ PlanRow {
601+ owner : c. owner . to_string ( ) ,
602+ client_ip : c. client_ip . to_string ( ) ,
603+ device : c. device_label . clone ( ) ,
604+ nearest_device : nearest,
605+ client : c. software_client . clone ( ) ,
606+ stake_sol : format ! ( "{:.2}" , c. stake_sol) ,
607+ }
608+ } )
609+ . collect ( ) ;
610+ print_table ( plan_rows, & OutputOptions { json : false } , & [ 5 ] ) ;
592611 eprintln ! ( ) ;
593612
594613 if self . dry_run {
0 commit comments