1pub mod Entry;
7
8pub type MainResult<T> = anyhow::Result<T>;
10
11#[derive(Debug, Clone)]
13pub struct CliArgs {
14 pub mode:String,
16 pub extension:Option<String>,
18 pub transport:String,
20 pub grpc_address:String,
22 pub mountain_address:String,
24 pub wasi:bool,
26 pub memory_limit_mb:u64,
28 pub max_execution_time_ms:u64,
30 pub verbose:bool,
32}
33
34impl Default for CliArgs {
35 fn default() -> Self {
36 Self {
37 mode:"standalone".to_string(),
38 extension:None,
39 transport:"wasm".to_string(),
40 grpc_address:"127.0.0.1:50051".to_string(),
41 mountain_address:"127.0.0.1:50050".to_string(),
42 wasi:true,
43 memory_limit_mb:512,
44 max_execution_time_ms:30000,
45 verbose:false,
46 }
47 }
48}
49
50#[cfg(test)]
51mod tests {
52 use super::*;
53
54 #[test]
55 fn test_cli_args_default() {
56 let args = CliArgs::default();
57 assert_eq!(args.mode, "standalone");
58 assert_eq!(args.transport, "wasm");
59 assert!(args.wasi);
60 assert_eq!(args.memory_limit_mb, 512);
61 }
62}