@@ -61,16 +61,16 @@ pub struct Cli {
6161 #[ arg( long) ]
6262 pub experimental : bool ,
6363
64- /// Export full JSON result to a file
64+ /// Export results as JSON
6565 #[ arg( long) ]
6666 pub export_json : Option < std:: path:: PathBuf > ,
6767
68- /// Export a one-line CSV summary to a file
68+ /// Export results as CSV
6969 #[ arg( long) ]
7070 pub export_csv : Option < std:: path:: PathBuf > ,
7171
72- /// Automatically save test results (default: true)
73- #[ arg( long, default_value_t = true ) ]
72+ /// Use --auto- save true or --auto-save false to override (default: true)
73+ #[ arg( long, default_value_t = true , action = clap :: ArgAction :: Set ) ]
7474 pub auto_save : bool ,
7575
7676 /// Bind to a specific network interface (e.g., ens18, eth0)
@@ -150,8 +150,10 @@ async fn run_json(args: Cli) -> Result<()> {
150150 handle_exports ( & args, & result) ?;
151151
152152 println ! ( "{}" , serde_json:: to_string_pretty( & result) ?) ;
153- if let Ok ( p) = crate :: storage:: save_run ( & result) {
154- eprintln ! ( "Saved: {}" , p. display( ) ) ;
153+ if args. auto_save {
154+ if let Ok ( p) = crate :: storage:: save_run ( & result) {
155+ eprintln ! ( "Saved: {}" , p. display( ) ) ;
156+ }
155157 }
156158 Ok ( ( ) )
157159}
@@ -250,8 +252,10 @@ async fn run_text(args: Cli) -> Result<()> {
250252 exp. target
251253 ) ;
252254 }
253- if let Ok ( p) = crate :: storage:: save_run ( & result) {
254- eprintln ! ( "Saved: {}" , p. display( ) ) ;
255+ if args. auto_save {
256+ if let Ok ( p) = crate :: storage:: save_run ( & result) {
257+ eprintln ! ( "Saved: {}" , p. display( ) ) ;
258+ }
255259 }
256260 Ok ( ( ) )
257261}
0 commit comments