@@ -2,9 +2,10 @@ use anyhow::anyhow;
2
2
use clap:: { Parser , ValueEnum } ;
3
3
use std:: collections:: HashMap ;
4
4
use std:: net:: IpAddr ;
5
+ use std:: process;
5
6
use std:: str:: FromStr ;
6
7
use std:: time:: Duration ;
7
- use strum:: { EnumString , EnumVariantNames } ;
8
+ use strum:: { EnumString , EnumVariantNames , VariantNames } ;
8
9
use trippy:: tracing:: { MultipathStrategy , PortDirection , TracerAddrFamily , TracerProtocol } ;
9
10
10
11
/// The maximum number of hops we allow.
@@ -271,6 +272,10 @@ pub struct Args {
271
272
#[ clap( long, num_args( 0 ..) , value_delimiter( ',' ) , value_parser = parse_tui_color_value, display_order = 31 ) ]
272
273
pub tui_color : Vec < Option < ( TuiItem , TuiColor ) > > ,
273
274
275
+ /// Print all TUI theme items and exit
276
+ #[ clap( long, display_order = 32 ) ]
277
+ pub print_tui_items : bool ,
278
+
274
279
/// The number of report cycles to run
275
280
#[ clap(
276
281
short = 'c' ,
@@ -522,6 +527,10 @@ impl TryFrom<(Args, u16)> for TrippyConfig {
522
527
#[ allow( clippy:: too_many_lines) ]
523
528
fn try_from ( data : ( Args , u16 ) ) -> Result < Self , Self :: Error > {
524
529
let ( args, pid) = data;
530
+ if args. print_tui_items {
531
+ println ! ( "TUI theme color items: {}" , TuiItem :: VARIANTS . join( ", " ) ) ;
532
+ process:: exit ( 0 ) ;
533
+ }
525
534
let protocol = match ( args. udp , args. tcp , args. protocol ) {
526
535
( false , false , Protocol :: Icmp ) => TracerProtocol :: Icmp ,
527
536
( false , false , Protocol :: Udp ) | ( true , _, _) => TracerProtocol :: Udp ,
0 commit comments