|
2 | 2 | // Licensed under the MIT License.
|
3 | 3 |
|
4 | 4 | #[cfg(windows)]
|
5 |
| -use registry_lib::{config::RegistryValueData, RegistryHelper}; |
| 5 | +use { |
| 6 | + registry_lib::{config::RegistryValueData, RegistryHelper}, |
| 7 | + crate::args::DefaultShell |
| 8 | +}; |
6 | 9 |
|
7 | 10 | use std::path::Path;
|
8 |
| - |
9 |
| -use crate::args::DefaultShell; |
10 | 11 | use crate::error::SshdConfigError;
|
11 | 12 |
|
12 | 13 | /// Invoke the set command.
|
@@ -69,16 +70,18 @@ fn set_default_shell(shell: Option<String>, cmd_option: Option<String>, escape_a
|
69 | 70 | }
|
70 | 71 |
|
71 | 72 | #[cfg(not(windows))]
|
72 |
| -pub fn set_default_shell(shell: Option<String>, cmd_option: Option<String>, escape_arguments: Option<bool>, shell_arguments: Option<Vec<String>>) -> Result<(), SshdConfigError> { |
| 73 | +pub fn set_default_shell(_shell: Option<String>, _cmd_option: Option<String>, _escape_arguments: Option<bool>, _shell_arguments: Option<Vec<String>>) -> Result<(), SshdConfigError> { |
73 | 74 | Err(SshdConfigError::InvalidInput("Windows registry operations not applicable to this platform".to_string()))
|
74 | 75 | }
|
75 | 76 |
|
| 77 | +#[cfg(windows)] |
76 | 78 | fn set_registry(name: &str, data: RegistryValueData) -> Result<(), SshdConfigError> {
|
77 | 79 | let registry_helper = RegistryHelper::new("HKLM\\SOFTWARE\\OpenSSH", Some(name.to_string()), Some(data))?;
|
78 | 80 | registry_helper.set()?;
|
79 | 81 | Ok(())
|
80 | 82 | }
|
81 | 83 |
|
| 84 | +#[cfg(windows)] |
82 | 85 | fn remove_registry(name: &str) -> Result<(), SshdConfigError> {
|
83 | 86 | let registry_helper = RegistryHelper::new("HKLM\\SOFTWARE\\OpenSSH", Some(name.to_string()), None)?;
|
84 | 87 | registry_helper.remove()?;
|
|
0 commit comments