Updates in thrussh-config: shell expansions, default config
[?]
Dec 5, 2020, 11:19 AM
SW5Z7UCNVHQNRXLVZQQMNJRQGQ2QBHYCTLPXU7GELNURZRYDZOMQCDependencies
- [2]
JBFDZQ46Formatting - [3]
2Q2DF2ROUpdating thrussh-config to make it usable in real projects - [4]
7FRJYUI6Reboot because of a bad change
Change contents
- replacement in thrussh-config/src/lib.rs at line 28
#[derive(Debug, Default)]#[derive(Debug)] - replacement in thrussh-config/src/lib.rs at line 30
pub user: Option<String>,pub user: String, - edit in thrussh-config/src/lib.rs at line 36
}impl Config {pub fn default(host_name: &str) -> Self {Config {user: whoami::username(),host_name: host_name.to_string(),port: 22,identity_file: None,proxy_command: None,add_keys_to_agent: AddKeysToAgent::default(),}} - replacement in thrussh-config/src/lib.rs at line 118
"user" => config.user = Some(value.trim_start().to_string()),"user" => {config.user.clear();config.user.push_str(value.trim_start());} - replacement in thrussh-config/src/lib.rs at line 131
"identityfile" => config.identity_file = Some(value.trim_start().to_string()),"identityfile" => {let id = value.trim_start();if id.starts_with("~/") {if let Some(mut home) = dirs_next::home_dir() {home.push(id.split_at(2).1);config.identity_file = Some(home.to_str().unwrap().to_string());} else {return Err(Error::NoHome);}} else {config.identity_file = Some(id.to_string())}} - replacement in thrussh-config/src/lib.rs at line 159
let mut c = Config::default();c.host_name.push_str(host);let mut c = Config::default(host);