Commit 6646568 1 parent 23cb6bf commit 6646568 Copy full SHA for 6646568
File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ mod warnings;
26
26
#[ tokio:: main]
27
27
async fn main ( ) -> color_eyre:: Result < ( ) > {
28
28
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) ;
29
36
30
37
match args. subcmd {
31
38
Some ( config:: OptionalCmd :: GenConfig ) => {
@@ -40,16 +47,10 @@ async fn main() -> color_eyre::Result<()> {
40
47
None => { }
41
48
}
42
49
43
- let retain_for = args. retain_for ( ) ;
44
- args. trace_init ( ) ?;
45
- tracing:: debug!( ?args. target_addr, ?args. view_options) ;
46
-
47
50
let target = args. target_addr ( ) ;
48
51
tracing:: info!( ?target, "using target addr" ) ;
49
52
50
- let styles = view:: Styles :: from_config ( args. view_options ) ;
51
- styles. error_init ( ) ?;
52
-
53
+ let retain_for = args. retain_for ( ) ;
53
54
let ( mut terminal, _cleanup) = term:: init_crossterm ( ) ?;
54
55
terminal. clear ( ) ?;
55
56
let mut conn = conn:: Connection :: new ( target) ;
You can’t perform that action at this time.
0 commit comments