@@ -19,6 +19,9 @@ struct Args {
1919
2020 #[ clap( short, long, help = "Specific output path to save the SRS file. If not provided, saves to a default directory." ) ]
2121 output_path : Option < String > ,
22+
23+ #[ clap( short, long, help = "Enable recursive mode for circuit size calculation." ) ]
24+ recursive : bool ,
2225}
2326
2427fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
@@ -44,7 +47,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
4447 }
4548
4649 println ! ( "Circuit '{}' decoded. Downloading SRS..." , circuit_name) ;
47- let subgroup_size = get_subgroup_size ( bytecode, false ) ;
50+ let subgroup_size = get_subgroup_size ( bytecode, args . recursive ) ;
4851 let srs: Srs = get_srs ( subgroup_size, None ) ;
4952 local_srs = LocalSrs ( srs) ;
5053 println ! ( "SRS for '{}' downloaded." , circuit_name) ;
@@ -95,6 +98,7 @@ mod tests {
9598 Args {
9699 circuit_path : circuit_path. map ( String :: from) ,
97100 output_path : output_path. map ( String :: from) ,
101+ recursive : false ,
98102 }
99103 }
100104
@@ -125,6 +129,22 @@ mod tests {
125129 assert_eq ! ( args. circuit_path, Some ( "test.json" . to_string( ) ) ) ;
126130 assert_eq ! ( args. output_path, Some ( "output/srs.srs" . to_string( ) ) ) ;
127131 }
132+
133+ #[ test]
134+ fn test_args_parsing_recursive_default ( ) {
135+ let args = create_args ( None , None ) ;
136+ assert_eq ! ( args. recursive, false ) ;
137+ }
138+
139+ #[ test]
140+ fn test_args_parsing_recursive_explicit ( ) {
141+ let args = Args {
142+ circuit_path : None ,
143+ output_path : None ,
144+ recursive : true ,
145+ } ;
146+ assert_eq ! ( args. recursive, true ) ;
147+ }
128148
129149 #[ test]
130150 fn test_save_path_default_no_circuit ( ) {
0 commit comments