MCPcopy Create free account
hub / github.com/PowerShell/DSC / require_input

Function require_input

resources/windows_firewall/src/main.rs:36–52  ·  view source on GitHub ↗
(input_json: Option<String>)

Source from the content-addressed store, hash-verified

34}
35
36fn 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))]
55fn main() {

Callers 1

mainFunction · 0.70

Calls 2

write_errorFunction · 0.70
from_strFunction · 0.50

Tested by

no test coverage detected