Invoke the get command. # Errors This function will return an error if the desired settings cannot be retrieved.
(input: Option<&String>, setting: &Setting)
| 30 | /// |
| 31 | /// This function will return an error if the desired settings cannot be retrieved. |
| 32 | pub fn invoke_get(input: Option<&String>, setting: &Setting) -> Result<Map<String, Value>, SshdConfigError> { |
| 33 | debug!("{} {:?}", t!("get.debugSetting").to_string(), setting); |
| 34 | trace!("{} {:?}", t!("get.traceInput").to_string(), input); |
| 35 | match *setting { |
| 36 | Setting::SshdConfig => { |
| 37 | let cmd_info = build_command_info(input, true)?; |
| 38 | get_sshd_settings(&cmd_info, true) |
| 39 | }, |
| 40 | Setting::WindowsGlobal => { |
| 41 | get_default_shell()?; |
| 42 | Ok(Map::new()) |
| 43 | }, |
| 44 | _ => { |
| 45 | Err(SshdConfigError::InvalidInput(t!("get.invalidSetting", setting = format!("{:?}", setting)).to_string())) |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | #[cfg(windows)] |
| 51 | fn get_default_shell() -> Result<(), SshdConfigError> { |
no test coverage detected