(configurator: &mut Configurator, format: Option<&OutputFormat>, as_group: &bool)
| 80 | } |
| 81 | |
| 82 | pub fn config_set(configurator: &mut Configurator, format: Option<&OutputFormat>, as_group: &bool) |
| 83 | { |
| 84 | match configurator.invoke_set(false) { |
| 85 | Ok(result) => { |
| 86 | if *as_group { |
| 87 | let json = match serde_json::to_string(&(result.results)) { |
| 88 | Ok(json) => json, |
| 89 | Err(err) => { |
| 90 | error!("JSON Error: {err}"); |
| 91 | exit(EXIT_JSON_ERROR); |
| 92 | } |
| 93 | }; |
| 94 | write_object(&json, format, false); |
| 95 | } |
| 96 | else { |
| 97 | let json = match serde_json::to_string(&result) { |
| 98 | Ok(json) => json, |
| 99 | Err(err) => { |
| 100 | error!("JSON Error: {err}"); |
| 101 | exit(EXIT_JSON_ERROR); |
| 102 | } |
| 103 | }; |
| 104 | write_object(&json, format, false); |
| 105 | if result.had_errors { |
| 106 | exit(EXIT_DSC_ERROR); |
| 107 | } |
| 108 | } |
| 109 | }, |
| 110 | Err(err) => { |
| 111 | error!("Error: {err}"); |
| 112 | exit(EXIT_DSC_ERROR); |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | pub fn config_test(configurator: &mut Configurator, format: Option<&OutputFormat>, as_group: &bool, as_get: &bool, as_config: &bool, as_assert: &bool) |
| 118 | { |
no test coverage detected