@@ -11,37 +11,24 @@ struct Cli {
1111 /// Input WebAssembly binary (.wasm)
1212 input : PathBuf ,
1313
14- /// Code generation backend
15- #[ arg( long, default_value = "safe" , value_parser = [ "safe" , "verified" , "hybrid" ] ) ]
16- mode : String ,
17-
1814 /// Output Rust source file
1915 #[ arg( long, short) ]
2016 output : Option < PathBuf > ,
21-
22- /// Override maximum memory pages when the Wasm module declares no maximum
23- #[ arg( long, default_value = "256" ) ]
24- max_pages : usize ,
2517}
2618
2719fn main ( ) -> Result < ( ) > {
2820 let cli = Cli :: parse ( ) ;
2921
30- eprintln ! (
31- "herkos: transpiling {} (mode={}, max_pages={})" ,
32- cli. input. display( ) ,
33- cli. mode,
34- cli. max_pages,
35- ) ;
22+ eprintln ! ( "herkos: transpiling {}" , cli. input. display( ) , ) ;
3623
3724 // Read WASM file
3825 let wasm_bytes =
3926 fs:: read ( & cli. input ) . with_context ( || format ! ( "failed to read {}" , cli. input. display( ) ) ) ?;
4027
4128 // Configure transpilation options
4229 let options = TranspileOptions {
43- mode : cli . mode . clone ( ) ,
44- max_pages : cli . max_pages ,
30+ mode : "safe" . to_string ( ) ,
31+ max_pages : 256 ,
4532 } ;
4633
4734 // Transpile using library function
@@ -68,7 +55,7 @@ mod tests {
6855 #[ test]
6956 fn cli_parses_defaults ( ) {
7057 let cli = Cli :: parse_from ( [ "herkos" , "input.wasm" ] ) ;
71- assert_eq ! ( cli. mode , "safe" ) ;
72- assert_eq ! ( cli. max_pages , 256 ) ;
58+ assert_eq ! ( cli. input , PathBuf :: from ( "input.wasm" ) ) ;
59+ assert ! ( cli. output . is_none ( ) ) ;
7360 }
7461}
0 commit comments