diff --git a/src/cli/args.rs b/src/cli/args.rs index 898eb150..cd1a88af 100644 --- a/src/cli/args.rs +++ b/src/cli/args.rs @@ -1050,6 +1050,24 @@ mod tests { assert_eq!(args.contract.to_str().unwrap(), "contract.wasm"); assert_eq!(args.network_snapshot.unwrap().to_str().unwrap(), "state.json"); } + + #[test] + fn replay_accepts_format_flag() { + let cli = Cli::parse_from([ + "soroban-debug", + "replay", + "trace.json", + "--format", + "json", + ]); + + let Commands::Replay(args) = cli.command.expect("replay command expected") else { + panic!("replay command expected"); + }; + + assert_eq!(args.format, OutputFormat::Json); + assert_eq!(args.trace_file.to_str().unwrap(), "trace.json"); + } } #[derive(Parser)] @@ -1262,6 +1280,10 @@ pub struct ReplayArgs { /// Show verbose output during replay #[arg(short, long)] pub verbose: bool, + + /// Output format for the diff report (pretty or json) + #[arg(long, value_enum, default_value_t = OutputFormat::Pretty)] + pub format: OutputFormat, } #[derive(Parser)]