1pub mod Entry;
7
8pub type MainResult<T> = anyhow::Result<T>;
10
11#[derive(Debug, Clone)]
13pub struct CliArgs {
14 pub mode:String,
16
17 pub extension:Option<String>,
19
20 pub transport:String,
22
23 pub grpc_address:String,
25
26 pub mountain_address:String,
28
29 pub wasi:bool,
31
32 pub memory_limit_mb:u64,
34
35 pub max_execution_time_ms:u64,
37
38 pub verbose:bool,
40}
41
42impl Default for CliArgs {
43 fn default() -> Self {
44 Self {
45 mode:"standalone".to_string(),
46
47 extension:None,
48
49 transport:"wasm".to_string(),
50
51 grpc_address:"127.0.0.1:50051".to_string(),
52
53 mountain_address:"127.0.0.1:50050".to_string(),
54
55 wasi:true,
56
57 memory_limit_mb:512,
58
59 max_execution_time_ms:30000,
60
61 verbose:false,
62 }
63 }
64}
65
66#[cfg(test)]
67mod tests {
68
69 use super::*;
70
71 #[test]
72 fn test_cli_args_default() {
73 let args = CliArgs::default();
74
75 assert_eq!(args.mode, "standalone");
76
77 assert_eq!(args.transport, "wasm");
78
79 assert!(args.wasi);
80
81 assert_eq!(args.memory_limit_mb, 512);
82 }
83}