(input_json: Option<String>)
| 34 | } |
| 35 | |
| 36 | fn require_input(input_json: Option<String>) -> FirewallRuleList { |
| 37 | let json = match input_json { |
| 38 | Some(json) => json, |
| 39 | None => { |
| 40 | write_error(&t!("main.missingInput")); |
| 41 | exit(EXIT_INVALID_ARGS); |
| 42 | } |
| 43 | }; |
| 44 | |
| 45 | match serde_json::from_str(&json) { |
| 46 | Ok(value) => value, |
| 47 | Err(error) => { |
| 48 | write_error(&t!("main.invalidJson", error = error.to_string())); |
| 49 | exit(EXIT_INVALID_INPUT); |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | #[cfg(not(windows))] |
| 55 | fn main() { |
no test coverage detected