File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ mod warnings;
2626#[ tokio:: main]
2727async fn main ( ) -> color_eyre:: Result < ( ) > {
2828 let mut args = config:: Config :: parse ( ) ?;
29+ // initialize error handling first, in case panics occur while setting up
30+ // other stuff.
31+ let styles = view:: Styles :: from_config ( args. view_options . clone ( ) ) ;
32+ styles. error_init ( ) ?;
33+
34+ args. trace_init ( ) ?;
35+ tracing:: debug!( ?args. target_addr, ?args. view_options) ;
2936
3037 match args. subcmd {
3138 Some ( config:: OptionalCmd :: GenConfig ) => {
@@ -40,16 +47,10 @@ async fn main() -> color_eyre::Result<()> {
4047 None => { }
4148 }
4249
43- let retain_for = args. retain_for ( ) ;
44- args. trace_init ( ) ?;
45- tracing:: debug!( ?args. target_addr, ?args. view_options) ;
46-
4750 let target = args. target_addr ( ) ;
4851 tracing:: info!( ?target, "using target addr" ) ;
4952
50- let styles = view:: Styles :: from_config ( args. view_options ) ;
51- styles. error_init ( ) ?;
52-
53+ let retain_for = args. retain_for ( ) ;
5354 let ( mut terminal, _cleanup) = term:: init_crossterm ( ) ?;
5455 terminal. clear ( ) ?;
5556 let mut conn = conn:: Connection :: new ( target) ;
You can’t perform that action at this time.
0 commit comments