pijul nest
guest [sign in]

Updates in thrussh-config: shell expansions, default config

[?]
Dec 5, 2020, 11:19 AM
SW5Z7UCNVHQNRXLVZQQMNJRQGQ2QBHYCTLPXU7GELNURZRYDZOMQC

Dependencies

  • [2] JBFDZQ46 Formatting
  • [3] 2Q2DF2RO Updating thrussh-config to make it usable in real projects
  • [4] 7FRJYUI6 Reboot because of a bad change

Change contents

  • replacement in thrussh-config/src/lib.rs at line 28
    [3.161525][3.161525:161551]()
    #[derive(Debug, Default)]
    [3.161525]
    [3.161551]
    #[derive(Debug)]
  • replacement in thrussh-config/src/lib.rs at line 30
    [3.161571][3.161571:161601]()
    pub user: Option<String>,
    [3.161571]
    [3.30]
    pub user: String,
  • edit in thrussh-config/src/lib.rs at line 36
    [3.161784]
    [3.161784]
    }
    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
    [3.163342][3.163342:163424]()
    "user" => config.user = Some(value.trim_start().to_string()),
    [3.163342]
    [3.735]
    "user" => {
    config.user.clear();
    config.user.push_str(value.trim_start());
    }
  • replacement in thrussh-config/src/lib.rs at line 131
    [3.1057][3.163592:163691](),[2.582][3.163592:163691](),[3.163592][3.163592:163691]()
    "identityfile" => config.identity_file = Some(value.trim_start().to_string()),
    [2.582]
    [3.163691]
    "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
    [3.164480][3.1058:1173]()
    let mut c = Config::default();
    c.host_name.push_str(host);
    [3.164480]
    [3.1173]
    let mut c = Config::default(host);